diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-14 16:01:26 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-14 16:01:26 +0200 |
commit | 4d364d3e77667b70bf3261da004f4990ef0c3ada (patch) | |
tree | 5a106ca427ba8704635b3324a352475dd8706ab8 /src/uniquekey.h | |
parent | a925a9ee21c10184a08625e83d2b55850d6cb32f (diff) | |
download | lanes-4d364d3e77667b70bf3261da004f4990ef0c3ada.tar.gz lanes-4d364d3e77667b70bf3261da004f4990ef0c3ada.tar.bz2 lanes-4d364d3e77667b70bf3261da004f4990ef0c3ada.zip |
lua_pushliteral -> luaG_pushstring
Diffstat (limited to 'src/uniquekey.h')
-rw-r--r-- | src/uniquekey.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/uniquekey.h b/src/uniquekey.h index 94c09c7..debfee4 100644 --- a/src/uniquekey.h +++ b/src/uniquekey.h | |||
@@ -105,16 +105,16 @@ class RegistryUniqueKey | |||
105 | return false; | 105 | return false; |
106 | } | 106 | } |
107 | // --------------------------------------------------------------------------------------------- | 107 | // --------------------------------------------------------------------------------------------- |
108 | void getSubTableMode(lua_State* const L_, char const* const mode_) const | 108 | void getSubTableMode(lua_State* const L_, std::string_view const& mode_) const |
109 | { | 109 | { |
110 | STACK_CHECK_START_REL(L_, 0); | 110 | STACK_CHECK_START_REL(L_, 0); |
111 | if (!getSubTable(L_, 0, 0)) { // L_: {} | 111 | if (!getSubTable(L_, 0, 0)) { // L_: {} |
112 | // Set its metatable if requested | 112 | // Set its metatable if requested |
113 | if (mode_) { | 113 | if (!mode_.empty()) { |
114 | STACK_GROW(L_, 3); | 114 | STACK_GROW(L_, 3); |
115 | lua_createtable(L_, 0, 1); // L_: {} mt | 115 | lua_createtable(L_, 0, 1); // L_: {} mt |
116 | lua_pushliteral(L_, "__mode"); // L_: {} mt "__mode" | 116 | luaG_pushstring(L_, "__mode"); // L_: {} mt "__mode" |
117 | lua_pushstring(L_, mode_); // L_: {} mt "__mode" mode | 117 | luaG_pushstring(L_, mode_); // L_: {} mt "__mode" mode |
118 | lua_rawset(L_, -3); // L_: {} mt | 118 | lua_rawset(L_, -3); // L_: {} mt |
119 | lua_setmetatable(L_, -2); // L_: {} | 119 | lua_setmetatable(L_, -2); // L_: {} |
120 | } | 120 | } |