Skip to content

Commit 72b79b7

Browse files
committed
---
yaml --- r: 103403 b: refs/heads/auto c: adeb730 h: refs/heads/master i: 103401: 0cbb83b 103399: 2b0ae85 v: v3
1 parent 46a64de commit 72b79b7

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 72b5e30f6cd99f27510cb48f8882f25b31ed9d8b
16+
refs/heads/auto: adeb730c7796156bd5fb63d75e13cab655b10ece
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libstd/hash/sip.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,31 +231,31 @@ impl Default for SipState {
231231
/// `SipHasher` computes the SipHash algorithm from a stream of bytes.
232232
#[deriving(Clone)]
233233
pub struct SipHasher {
234-
priv state: SipState,
234+
priv k0: u64,
235+
priv k1: u64,
235236
}
236237

237238
impl SipHasher {
238239
/// Create a `Sip`.
239240
#[inline]
240241
pub fn new() -> SipHasher {
241-
SipHasher {
242-
state: SipState::new(),
243-
}
242+
SipHasher::new_with_keys(0, 0)
244243
}
245244

246245
/// Create a `Sip` that is keyed off the provided keys.
247246
#[inline]
248247
pub fn new_with_keys(key0: u64, key1: u64) -> SipHasher {
249248
SipHasher {
250-
state: SipState::new_with_keys(key0, key1),
249+
k0: key0,
250+
k1: key1,
251251
}
252252
}
253253
}
254254

255255
impl Hasher<SipState> for SipHasher {
256256
#[inline]
257257
fn hash<T: Hash<SipState>>(&self, value: &T) -> u64 {
258-
let mut state = self.state.clone();
258+
let mut state = SipState::new_with_keys(self.k0, self.k1);
259259
value.hash(&mut state);
260260
state.result()
261261
}

0 commit comments

Comments
 (0)