From 47baebc68cb0cd36e9e098d33314ff533a5e65c6 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Sat, 27 Oct 2012 17:07:45 -0700 Subject: [PATCH] Remove un-needed comparisons, suppress warnings --- src/libcore/hash.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcore/hash.rs b/src/libcore/hash.rs index e3bbfbc4129d..d938a1d41a32 100644 --- a/src/libcore/hash.rs +++ b/src/libcore/hash.rs @@ -505,7 +505,7 @@ pub fn test_hash_no_bytes_dropped_64() { assert val.hash() != zero_byte(val, 7).hash(); fn zero_byte(val: u64, byte: uint) -> u64 { - assert 0 <= byte; assert byte < 8; + assert byte < 8; val & !(0xff << (byte * 8)) } } @@ -520,7 +520,7 @@ pub fn test_hash_no_bytes_dropped_32() { assert val.hash() != zero_byte(val, 3).hash(); fn zero_byte(val: u32, byte: uint) -> u32 { - assert 0 <= byte; assert byte < 4; + assert byte < 4; val & !(0xff << (byte * 8)) } }