Skip to content

Commit

Permalink
perf: avoid iterators for keeping rc limits
Browse files Browse the repository at this point in the history
  • Loading branch information
Oppen committed Jul 4, 2023
1 parent 6fc69cd commit 92177c9
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions vm/src/vm/vm_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,15 +405,10 @@ impl VirtualMachine {
instruction.off1 + (1_isize << (OFFSET_BITS - 1)),
instruction.off2 + (1_isize << (OFFSET_BITS - 1)),
);
let (min, max) = self.rc_limits.unwrap_or((off0, off0));
self.rc_limits = Some((
[self.rc_limits.unwrap_or((off0, off0)).0, off0, off1, off2]
.into_iter()
.min()
.unwrap(),
[self.rc_limits.unwrap_or((off0, off0)).1, off0, off1, off2]
.into_iter()
.max()
.unwrap(),
min.min(off0).min(off1).min(off2),
max.max(off0).max(off1).max(off2),
));

self.segments
Expand Down

0 comments on commit 92177c9

Please sign in to comment.