From 563d6993946e157a7611ef1fd9f24ddcb9e164f7 Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Thu, 7 Mar 2024 17:33:27 -0500 Subject: [PATCH] Avoid an extra operation if `!labelScope` (thanks, ISSOtm) --- src/asm/symbol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/asm/symbol.cpp b/src/asm/symbol.cpp index e2d4812c..5b2c1bde 100644 --- a/src/asm/symbol.cpp +++ b/src/asm/symbol.cpp @@ -153,7 +153,7 @@ Symbol *sym_FindScopedSymbol(char const *symName) { fatalerror("'%s' is a nonsensical reference to a nested local symbol\n", symName); // If auto-scoped local label, expand the name if (localName == symName) { // Meaning, the name begins with the dot - std::string fullName = labelScope.value_or(std::string()) + symName; + std::string fullName = labelScope ? *labelScope + symName : symName; return sym_FindExactSymbol(fullName.c_str()); }