Skip to content

Commit

Permalink
Allow LuaVal set metamethod to return value
Browse files Browse the repository at this point in the history
This allows us to do something similar to the following:

local value = obj:Data():Get("key") or obj:Data():Set("key", val)
  • Loading branch information
Foereaper authored Apr 4, 2024
1 parent edcbc7a commit 08a55ae
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions LuaValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ int LuaVal::lua_set(lua_State* L) {
}
else {
(**p).insert_or_assign(std::move(kk), std::move(vv));
return it->second.asObject(L);
}
return 0;
}
Expand Down

0 comments on commit 08a55ae

Please sign in to comment.