From 66fe54adefea2a7a2fefc371cc833eeda03cdae8 Mon Sep 17 00:00:00 2001 From: _ <_@_> Date: Mon, 2 Oct 2023 17:55:17 -0500 Subject: [PATCH] remove unused things --- lunar_wave_vm/src/state.rs | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/lunar_wave_vm/src/state.rs b/lunar_wave_vm/src/state.rs index 0b7d176..5a5d9d0 100644 --- a/lunar_wave_vm/src/state.rs +++ b/lunar_wave_vm/src/state.rs @@ -468,14 +468,6 @@ impl State { let block = self.chunk.blocks.get (frame.block_idx).unwrap (); let constants = &block.constants; - let value = if k { - &constants [usize::from (c)] - } - else { - self.reg (c) - } - .clone (); - let b = usize::try_from (b).unwrap (); let key = match constants.get (b).unwrap () { @@ -483,6 +475,13 @@ impl State { _ => panic! ("SetField only supports string keys"), }; + let value = if k { + &constants [usize::from (c)] + } + else { + self.reg_mut (c) + }.clone (); + let mut dst = self.reg (a).as_table () .expect ("SetField only works on tables").borrow_mut (); @@ -506,12 +505,8 @@ impl State { pub fn step (&mut self) -> Result