Skip to content

Commit c2d6235

Browse files
committed
Optimize result push
1 parent 180d1a3 commit c2d6235

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Diff for: lib/fizzy/execute.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,11 @@ inline bool invoke_function(const FuncType& func_type, uint32_t func_idx, Instan
9090
if (ret.trapped)
9191
return false;
9292

93-
const auto num_outputs = func_type.outputs.size();
9493
// NOTE: we can assume these two from validation
95-
assert(num_outputs <= 1);
96-
assert(ret.has_value == (num_outputs == 1));
94+
assert(func_type.outputs.size() <= 1);
95+
assert(ret.has_value == !func_type.outputs.empty());
9796
// Push back the result
98-
if (num_outputs != 0)
97+
if (ret.has_value != 0)
9998
stack.push(ret.value);
10099

101100
return true;

0 commit comments

Comments
 (0)