mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 10:42:07 +00:00
Avoid an extra operation if !labelScope (thanks, ISSOtm)
This commit is contained in:
@@ -153,7 +153,7 @@ Symbol *sym_FindScopedSymbol(char const *symName) {
|
|||||||
fatalerror("'%s' is a nonsensical reference to a nested local symbol\n", symName);
|
fatalerror("'%s' is a nonsensical reference to a nested local symbol\n", symName);
|
||||||
// If auto-scoped local label, expand the name
|
// If auto-scoped local label, expand the name
|
||||||
if (localName == symName) { // Meaning, the name begins with the dot
|
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());
|
return sym_FindExactSymbol(fullName.c_str());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user