File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -102,12 +102,13 @@ where
102102
103103 #[ inline]
104104 fn call ( & self , call : Self :: Call ) -> u128 {
105- // if let Some(accelerator) = crate::accelerate::get(self.id) {
106- // let mut map = accelerator.lock();
107- // let call_hash = crate::constraint::hash(&call);
108- // return *map.entry(call_hash).or_insert_with(|| self.value.call(call));
109- // }
110- let hash = self . value . call ( call. clone ( ) ) ;
105+ let hash = if let Some ( accelerator) = crate :: accelerate:: get ( self . id ) {
106+ let mut map = accelerator. lock ( ) ;
107+ let call_hash = crate :: constraint:: hash ( & call) ;
108+ * map. entry ( call_hash) . or_insert_with ( || self . value . call ( call. clone ( ) ) )
109+ } else {
110+ self . value . call ( call. clone ( ) )
111+ } ;
111112 if let Some ( sink) = self . sink {
112113 sink ( call, hash)
113114 }
You can’t perform that action at this time.
0 commit comments