INNER CODE UNIT · Rust
pop_context
GuildOfWeavers/distaff · src/processor/decoder/mod.rs:349
fn pop_context(&mut self) -> u128 {
// make sure the stack is not empty
assert!(self.ctx_depth > 0, "context stack underflow at step {}", self.step);
// shift all stack values by one item to the left
for i in 1..self.ctx_stack.len() {
self.ctx_stack[i - 1][self.step] = self.ctx_stack[i][self.step - 1];
}
// update the stack depth and return the value that was at the top of the stack
// before it was shifted to the left
self.ctx_depth -= 1;
return self.ctx_stack[0][self.step - 1];
}
/// Copies contents of the context stack from the previous to the current step.
fn copy_context_stack(&mut self) {
for i in 0..self.ctx_stack.len() {