File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
branches/auto/src/libstd/hash Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
13
13
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
14
14
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
15
15
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16
- refs/heads/auto: 72b5e30f6cd99f27510cb48f8882f25b31ed9d8b
16
+ refs/heads/auto: adeb730c7796156bd5fb63d75e13cab655b10ece
17
17
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
18
18
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
19
19
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
Original file line number Diff line number Diff line change @@ -231,31 +231,31 @@ impl Default for SipState {
231
231
/// `SipHasher` computes the SipHash algorithm from a stream of bytes.
232
232
#[ deriving( Clone ) ]
233
233
pub struct SipHasher {
234
- priv state : SipState ,
234
+ priv k0: u64 ,
235
+ priv k1: u64 ,
235
236
}
236
237
237
238
impl SipHasher {
238
239
/// Create a `Sip`.
239
240
#[ inline]
240
241
pub fn new ( ) -> SipHasher {
241
- SipHasher {
242
- state : SipState :: new ( ) ,
243
- }
242
+ SipHasher :: new_with_keys ( 0 , 0 )
244
243
}
245
244
246
245
/// Create a `Sip` that is keyed off the provided keys.
247
246
#[ inline]
248
247
pub fn new_with_keys ( key0 : u64 , key1 : u64 ) -> SipHasher {
249
248
SipHasher {
250
- state : SipState :: new_with_keys ( key0, key1) ,
249
+ k0 : key0,
250
+ k1 : key1,
251
251
}
252
252
}
253
253
}
254
254
255
255
impl Hasher < SipState > for SipHasher {
256
256
#[ inline]
257
257
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 ) ;
259
259
value. hash ( & mut state) ;
260
260
state. result ( )
261
261
}
You can’t perform that action at this time.
0 commit comments