File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,15 @@ where
109109 Out : Clone + ' static ,
110110 F : FnOnce ( In :: Tracked < ' c > ) -> Out ,
111111{
112+ // Compute the hash of the input's key part.
113+ let key = {
114+ let mut state = SipHasher13 :: new ( ) ;
115+ input. key ( & mut state) ;
116+ state. finish128 ( ) . as_u128 ( )
117+ } ;
118+
119+ std:: hint:: black_box ( key) ;
120+
112121 if let Some ( i) = PRESCIENCE_READ . get ( ) {
113122 if i != u32:: MAX {
114123 return cache. 0 . read ( ) . values [ i as usize ] . clone ( ) ;
@@ -128,13 +137,6 @@ where
128137 return value;
129138 }
130139
131- // Compute the hash of the input's key part.
132- let key = {
133- let mut state = SipHasher13 :: new ( ) ;
134- input. key ( & mut state) ;
135- state. finish128 ( ) . as_u128 ( )
136- } ;
137-
138140 // Check if there is a cached output.
139141 if let Some ( ( i, value, mutable) ) = cache. 0 . read ( ) . lookup :: < In > ( key, & input) {
140142 PRESCIENCE_WRITE . hit ( i) ;
You can’t perform that action at this time.
0 commit comments