mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-13 00:18:35 -07:00
computer: perf
This commit is contained in:
@@ -1340,11 +1340,13 @@ impl Vecs {
|
|||||||
|
|
||||||
let prev_timestamp = chain_state.last().unwrap().timestamp;
|
let prev_timestamp = chain_state.last().unwrap().timestamp;
|
||||||
|
|
||||||
self.age_range
|
let mut vecs = self
|
||||||
|
.age_range
|
||||||
.as_mut_vec()
|
.as_mut_vec()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|(filter, v)| (filter, &mut v.state))
|
.map(|(filter, v)| (filter, &mut v.state))
|
||||||
.for_each(|(filter, state)| {
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
let _ = chain_state
|
let _ = chain_state
|
||||||
.iter()
|
.iter()
|
||||||
.try_for_each(|block_state| -> ControlFlow<()> {
|
.try_for_each(|block_state| -> ControlFlow<()> {
|
||||||
@@ -1356,6 +1358,7 @@ impl Vecs {
|
|||||||
return ControlFlow::Continue(());
|
return ControlFlow::Continue(());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vecs.iter_mut().for_each(|(filter, state)| {
|
||||||
let is = filter.contains(days_old);
|
let is = filter.contains(days_old);
|
||||||
let was = filter.contains(prev_days_old);
|
let was = filter.contains(prev_days_old);
|
||||||
|
|
||||||
@@ -1364,10 +1367,10 @@ impl Vecs {
|
|||||||
} else if was && !is {
|
} else if was && !is {
|
||||||
state.decrement(&block_state.supply, block_state.price);
|
state.decrement(&block_state.supply, block_state.price);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
ControlFlow::Continue(())
|
ControlFlow::Continue(())
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn send(
|
pub fn send(
|
||||||
|
|||||||
Reference in New Issue
Block a user