Skip to content

Commit 071f873

Browse files
Improve naming
1 parent 43b6b9d commit 071f873

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

vm/src/vm/vm_core.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -602,18 +602,20 @@ impl VirtualMachine {
602602
hint_ranges: &mut HashMap<Relocatable, HintRange>,
603603
) -> Result<(), VirtualMachineError> {
604604
// Check if there is a hint range for the current pc
605-
if let Some((s, l)) = hint_ranges.get(&self.run_context.pc) {
605+
if let Some((start_hint_idx, n_hints)) = hint_ranges.get(&self.run_context.pc) {
606606
// Re-binding to avoid mutability problems
607-
let s = *s;
607+
let start_hint_idx = *start_hint_idx;
608608
// Execute each hint for the given range
609-
for idx in s..(s + l.get()) {
609+
for idx in start_hint_idx..(start_hint_idx + n_hints.get()) {
610610
let hint_data = hint_datas
611611
.get(idx)
612612
.ok_or(VirtualMachineError::Unexpected)?
613613
.as_ref();
614614
let hint_extension = hint_processor
615615
.execute_hint_extensive(self, exec_scopes, hint_data)
616-
.map_err(|err| VirtualMachineError::Hint(Box::new((idx - s, err))))?;
616+
.map_err(|err| {
617+
VirtualMachineError::Hint(Box::new((idx - start_hint_idx, err)))
618+
})?;
617619
// Update the hint_ranges & hint_datas with the hints added by the executed hint
618620
for (hint_pc, hints) in hint_extension {
619621
if let Ok(len) = NonZeroUsize::try_from(hints.len()) {

0 commit comments

Comments
 (0)