Skip to content

Commit c2b00a0

Browse files
committed
Reapply "WIP"
This reverts commit f209f06.
1 parent 4534e06 commit c2b00a0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/input.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)