Skip to content

Commit e70c686

Browse files
chfastaxic
authored andcommitted
Optimize result push
1 parent b874708 commit e70c686

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
@@ -465,12 +465,11 @@ inline bool invoke_function(const FuncType& func_type, uint32_t func_idx, Instan
465465

466466
stack.drop(num_args);
467467

468-
const auto num_outputs = func_type.outputs.size();
469468
// NOTE: we can assume these two from validation
470-
assert(num_outputs <= 1);
471-
assert(ret.has_value == (num_outputs == 1));
469+
assert(func_type.outputs.size() <= 1);
470+
assert(ret.has_value == !func_type.outputs.empty());
472471
// Push back the result
473-
if (num_outputs != 0)
472+
if (ret.has_value != 0)
474473
stack.push(ret.value);
475474

476475
return true;

0 commit comments

Comments
 (0)