don't use optional for debugName

This commit is contained in:
niki
2023-12-14 00:42:19 +01:00
parent 364b5c3b7b
commit c8da517759
9 changed files with 24 additions and 24 deletions
+4 -4
View File
@@ -477,11 +477,11 @@ int w_Texture_renderTo(lua_State *L)
static int w_Texture_getDebugName(lua_State *L)
{
Texture *t = luax_checktexture(L, 1);
const Optional<std::string> &debugName = t->getDebugName();
if (debugName.hasValue)
luax_pushstring(L, debugName.value);
else
const std::string &debugName = t->getDebugName();
if (debugName.empty())
lua_pushnil(L);
else
luax_pushstring(L, debugName);
return 1;
}