diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-24 12:21:00 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-24 12:21:00 +0200 |
commit | a3f500cd3ef0b4b333cc3bf403c64995dea33d5f (patch) | |
tree | 8a4923cccb918fc5b700388bc5874911fd3bad21 /src/compat.h | |
parent | 452f24128791a27511fcebbff8fdecc4f3151d49 (diff) | |
download | lanes-a3f500cd3ef0b4b333cc3bf403c64995dea33d5f.tar.gz lanes-a3f500cd3ef0b4b333cc3bf403c64995dea33d5f.tar.bz2 lanes-a3f500cd3ef0b4b333cc3bf403c64995dea33d5f.zip |
Having luaG_tostring return a non-empty string_view on non-string values was a bad idea
Diffstat (limited to 'src/compat.h')
-rw-r--r-- | src/compat.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compat.h b/src/compat.h index 7049f3d..41c8ea9 100644 --- a/src/compat.h +++ b/src/compat.h | |||
@@ -328,7 +328,7 @@ template <typename T> | |||
328 | { | 328 | { |
329 | size_t _len{ 0 }; | 329 | size_t _len{ 0 }; |
330 | char const* _str{ lua_tolstring(L_, idx_, &_len) }; | 330 | char const* _str{ lua_tolstring(L_, idx_, &_len) }; |
331 | return _str ? std::string_view{ _str, _len } : "<not a string>"; | 331 | return _str ? std::string_view{ _str, _len } : ""; |
332 | } | 332 | } |
333 | 333 | ||
334 | [[nodiscard]] inline std::string_view luaG_checkstring(lua_State* const L_, int const idx_) | 334 | [[nodiscard]] inline std::string_view luaG_checkstring(lua_State* const L_, int const idx_) |