File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -231,31 +231,31 @@ impl Default for SipState {
231231/// `SipHasher` computes the SipHash algorithm from a stream of bytes.
232232#[ deriving( Clone ) ]
233233pub struct SipHasher {
234- priv state : SipState ,
234+ priv k0: u64 ,
235+ priv k1: u64 ,
235236}
236237
237238impl 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
255255impl 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 }
You can’t perform that action at this time.
0 commit comments