Skip to content

Commit

Permalink
siphash: Remove one variable
Browse files Browse the repository at this point in the history
Without this temporary variable, codegen improves slightly and less
registers are spilled to the stack in SipHash::write.
  • Loading branch information
bluss committed Jul 25, 2015
1 parent f910d27 commit 5f6a61e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/libcore/hash/sip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,10 @@ impl SipHasher {

// Buffered tail is now flushed, process new input.
let len = length - needed;
let end = len & (!0x7);
let left = len & 0x7;

let mut i = needed;
while i < end {
while i < len - left {
let mi = unsafe { load_u64_le(msg, i) };

self.v3 ^= mi;
Expand Down

0 comments on commit 5f6a61e

Please sign in to comment.