mirror of
https://github.com/pezkuwichain/wasm-instrument.git
synced 2026-04-26 21:07:54 +00:00
Cleanup (#162)
* Remove unnecessary references * Shorten expressions * Remove unnecessary reference * Simplify expression * Fix formatting
This commit is contained in:
@@ -80,10 +80,7 @@ impl Stack {
|
||||
/// Returns `Err` if the control stack is empty.
|
||||
fn pop_frame(&mut self) -> Result<Frame, Error> {
|
||||
trace!(target: "max_height", "pop_frame: {:?}", self.control_stack.last());
|
||||
Ok(self
|
||||
.control_stack
|
||||
.pop()
|
||||
.ok_or_else(|| Error("stack must be non-empty".into()))?)
|
||||
self.control_stack.pop().ok_or_else(|| Error("stack must be non-empty".into()))
|
||||
}
|
||||
|
||||
/// Truncate the height of value stack to the specified height.
|
||||
|
||||
@@ -176,7 +176,7 @@ fn compute_stack_costs(module: &elements::Module) -> Result<Vec<u32>, Error> {
|
||||
// We can't calculate stack_cost of the import functions.
|
||||
Ok(0)
|
||||
} else {
|
||||
compute_stack_cost(func_idx as u32, &module)
|
||||
compute_stack_cost(func_idx as u32, module)
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
|
||||
Reference in New Issue
Block a user