Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/wasm-interpreter.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,9 @@ struct FuncData {

// A way to execute this function. We use this when it is called.
using Call = std::function<Flow(Literals)>;
std::optional<Call> call;
Call call;

FuncData(Name name,
void* self = nullptr,
std::optional<Call> call = std::nullopt)
FuncData(Name name, void* self = nullptr, Call call = {})
: name(name), self(self), call(call) {}

bool operator==(const FuncData& other) const {
Expand All @@ -155,7 +153,7 @@ struct FuncData {

Flow doCall(Literals arguments) {
assert(call);
return (*call)(arguments);
return call(arguments);
}
};

Expand Down
Loading