diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-09-24 10:33:34 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-09-24 10:33:34 +0200 |
commit | 1a0893dc9b3d003683c9db9866da13effb3592e3 (patch) | |
tree | 9989a72f1a30c1e320683075bdaa1ad025a74c1a /src/compat.h | |
parent | e1af4f31a1916a18d6ee0744bd91c1ee9d8651f4 (diff) | |
download | lanes-1a0893dc9b3d003683c9db9866da13effb3592e3.tar.gz lanes-1a0893dc9b3d003683c9db9866da13effb3592e3.tar.bz2 lanes-1a0893dc9b3d003683c9db9866da13effb3592e3.zip |
less char const* in the code
Diffstat (limited to 'src/compat.h')
-rw-r--r-- | src/compat.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compat.h b/src/compat.h index 2690a41..8b3eb98 100644 --- a/src/compat.h +++ b/src/compat.h | |||
@@ -184,9 +184,9 @@ concept RequiresOldLuaGetfield = requires(LUA_GETFIELD f_) | |||
184 | }; | 184 | }; |
185 | 185 | ||
186 | template <RequiresOldLuaGetfield LUA_GETFIELD> | 186 | template <RequiresOldLuaGetfield LUA_GETFIELD> |
187 | static inline int WrapLuaGetField(LUA_GETFIELD f_, lua_State* const L_, int const idx_, char const* const name_) | 187 | static inline int WrapLuaGetField(LUA_GETFIELD f_, lua_State* const L_, int const idx_, std::string_view const& name_) |
188 | { | 188 | { |
189 | f_(L_, idx_, name_); | 189 | f_(L_, idx_, name_.data()); |
190 | return lua_type(L_, -1); | 190 | return lua_type(L_, -1); |
191 | } | 191 | } |
192 | 192 | ||
@@ -201,16 +201,16 @@ concept RequiresNewLuaGetfield = requires(LUA_GETFIELD f_) | |||
201 | }; | 201 | }; |
202 | 202 | ||
203 | template <RequiresNewLuaGetfield LUA_GETFIELD> | 203 | template <RequiresNewLuaGetfield LUA_GETFIELD> |
204 | static inline int WrapLuaGetField(LUA_GETFIELD f_, lua_State* const L_, int const idx_, char const* const name_) | 204 | static inline int WrapLuaGetField(LUA_GETFIELD f_, lua_State* const L_, int const idx_, std::string_view const& name_) |
205 | { | 205 | { |
206 | return f_(L_, idx_, name_); | 206 | return f_(L_, idx_, name_.data()); |
207 | } | 207 | } |
208 | 208 | ||
209 | // ------------------------------------------------------------------------------------------------- | 209 | // ------------------------------------------------------------------------------------------------- |
210 | 210 | ||
211 | static inline LuaType luaG_getfield(lua_State* const L_, int const idx_, std::string_view const& name_) | 211 | static inline LuaType luaG_getfield(lua_State* const L_, int const idx_, std::string_view const& name_) |
212 | { | 212 | { |
213 | return static_cast<LuaType>(WrapLuaGetField(lua_getfield, L_, idx_, name_.data())); | 213 | return static_cast<LuaType>(WrapLuaGetField(lua_getfield, L_, idx_, name_)); |
214 | } | 214 | } |
215 | 215 | ||
216 | // ################################################################################################# | 216 | // ################################################################################################# |