From 6b12e320b4546ed18382fa1b191246daa1c3249d Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Fri, 27 May 2022 13:56:04 -0700 Subject: [Parser][NFC] Remove extraneous braces from std::optional returns (#4696) --- src/wasm/wat-lexer.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/wasm/wat-lexer.cpp') diff --git a/src/wasm/wat-lexer.cpp b/src/wasm/wat-lexer.cpp index 450d94a19..401ea6b7a 100644 --- a/src/wasm/wat-lexer.cpp +++ b/src/wasm/wat-lexer.cpp @@ -102,22 +102,22 @@ enum OverflowBehavior { DisallowOverflow, IgnoreOverflow }; std::optional getDigit(char c) { if ('0' <= c && c <= '9') { - return {c - '0'}; + return c - '0'; } - return std::nullopt; + return {}; } std::optional getHexDigit(char c) { if ('0' <= c && c <= '9') { - return {c - '0'}; + return c - '0'; } if ('A' <= c && c <= 'F') { - return {10 + c - 'A'}; + return 10 + c - 'A'; } if ('a' <= c && c <= 'f') { - return {10 + c - 'a'}; + return 10 + c - 'a'; } - return std::nullopt; + return {}; } // The result of lexing an integer token fragment. @@ -170,7 +170,7 @@ public: } } } - return {LexIntResult{*basic, negative ? -n : n, signedness}}; + return LexIntResult{*basic, negative ? -n : n, signedness}; } void takeSign() { @@ -285,9 +285,9 @@ public: std::optional lexed() { if (auto basic = LexCtx::lexed()) { if (escapeBuilder) { - return {LexStrResult{*basic, {escapeBuilder->str()}}}; + return LexStrResult{*basic, {escapeBuilder->str()}}; } else { - return {LexStrResult{*basic, {}}}; + return LexStrResult{*basic, {}}; } } return {}; -- cgit v1.2.3