We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5ac6546 commit b0e97f0Copy full SHA for b0e97f0
1 file changed
jit/tests/common.rs
@@ -128,17 +128,13 @@ impl StackMachine {
128
let mut values = Vec::new();
129
130
// Pop all values from stack:
131
- for _ in 0..amount {
132
- values.push(self.stack.pop().unwrap());
133
- }
+ values.extend(self.stack.drain(self.stack.len() - amount..));
134
135
// Push top of stack back first:
136
- self.stack.push(values.remove(0));
+ self.stack.push(values.pop().unwrap());
137
138
// Push other value back in order:
139
- for value in values.into_iter().rev() {
140
- self.stack.push(value);
141
+ self.stack.extend(values);
142
}
143
Instruction::ReturnValue => return true,
144
_ => unimplemented!(
0 commit comments