From fcae7bf2a8379dae46d63c91acadf25c824ec1b6 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Mon, 6 Oct 2025 15:36:50 -0700 Subject: [PATCH] [NFC] Remove unnecessary std::optional in FuncData std::function can already be empty, so wrapping it in std::optional is redundant. --- src/wasm-interpreter.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index 6cfa5821441..c37a76807c7 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -142,11 +142,9 @@ struct FuncData { // A way to execute this function. We use this when it is called. using Call = std::function; - std::optional call; + Call call; - FuncData(Name name, - void* self = nullptr, - std::optional call = std::nullopt) + FuncData(Name name, void* self = nullptr, Call call = {}) : name(name), self(self), call(call) {} bool operator==(const FuncData& other) const { @@ -155,7 +153,7 @@ struct FuncData { Flow doCall(Literals arguments) { assert(call); - return (*call)(arguments); + return call(arguments); } };