diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-14 15:23:21 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-14 15:23:21 +0200 |
commit | 149d6d6d16b10da9915e3018237405f6fe8749cf (patch) | |
tree | 3bf7ef659b5efd3d61bfd80eef2f48b9eff8d5ec /src/linda.cpp | |
parent | 792128255b6c6add22f97ea60734181cb915f2ae (diff) | |
download | lanes-149d6d6d16b10da9915e3018237405f6fe8749cf.tar.gz lanes-149d6d6d16b10da9915e3018237405f6fe8749cf.tar.bz2 lanes-149d6d6d16b10da9915e3018237405f6fe8749cf.zip |
More char* -> std::string_view conversions
Diffstat (limited to 'src/linda.cpp')
-rw-r--r-- | src/linda.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/linda.cpp b/src/linda.cpp index 316e917..3c04bae 100644 --- a/src/linda.cpp +++ b/src/linda.cpp | |||
@@ -162,7 +162,7 @@ std::string_view Linda::getName() const | |||
162 | } | 162 | } |
163 | if (std::holds_alternative<EmbeddedName>(nameVariant)) { | 163 | if (std::holds_alternative<EmbeddedName>(nameVariant)) { |
164 | char const* const _name{ std::get<EmbeddedName>(nameVariant).data() }; | 164 | char const* const _name{ std::get<EmbeddedName>(nameVariant).data() }; |
165 | return std::string_view{ _name, strlen(_name) }; | 165 | return std::string_view{ _name }; |
166 | } | 166 | } |
167 | return std::string_view{}; | 167 | return std::string_view{}; |
168 | } | 168 | } |
@@ -385,7 +385,7 @@ LUAG_FUNC(linda_dump) | |||
385 | { | 385 | { |
386 | auto _dump = [](lua_State* L_) { | 386 | auto _dump = [](lua_State* L_) { |
387 | Linda* const _linda{ ToLinda<false>(L_, 1) }; | 387 | Linda* const _linda{ ToLinda<false>(L_, 1) }; |
388 | return keeper_push_linda_storage(*_linda, DestState{ L_ }); | 388 | return Keeper::PushLindaStorage(*_linda, DestState{ L_ }); |
389 | }; | 389 | }; |
390 | return Linda::ProtectedCall(L_, _dump); | 390 | return Linda::ProtectedCall(L_, _dump); |
391 | } | 391 | } |
@@ -777,9 +777,9 @@ LUAG_FUNC(linda_set) | |||
777 | // make sure the key is of a valid type (throws an error if not the case) | 777 | // make sure the key is of a valid type (throws an error if not the case) |
778 | check_key_types(L_, 2, 2); | 778 | check_key_types(L_, 2, 2); |
779 | 779 | ||
780 | Keeper* const _keeper{ _linda->whichKeeper() }; | ||
781 | KeeperCallResult _pushed; | 780 | KeeperCallResult _pushed; |
782 | if (_linda->cancelRequest == CancelRequest::None) { | 781 | if (_linda->cancelRequest == CancelRequest::None) { |
782 | Keeper* const _keeper{ _linda->whichKeeper() }; | ||
783 | _pushed = keeper_call(_keeper->K, KEEPER_API(set), L_, _linda, 2); | 783 | _pushed = keeper_call(_keeper->K, KEEPER_API(set), L_, _linda, 2); |
784 | if (_pushed.has_value()) { // no error? | 784 | if (_pushed.has_value()) { // no error? |
785 | LUA_ASSERT(L_, _pushed.value() == 1 && luaG_type(L_, -1) == LuaType::BOOLEAN); | 785 | LUA_ASSERT(L_, _pushed.value() == 1 && luaG_type(L_, -1) == LuaType::BOOLEAN); |
@@ -823,7 +823,7 @@ LUAG_FUNC(linda_tostring) | |||
823 | LUAG_FUNC(linda_towatch) | 823 | LUAG_FUNC(linda_towatch) |
824 | { | 824 | { |
825 | Linda* const _linda{ ToLinda<false>(L_, 1) }; | 825 | Linda* const _linda{ ToLinda<false>(L_, 1) }; |
826 | int _pushed{ keeper_push_linda_storage(*_linda, DestState{ L_ }) }; | 826 | int _pushed{ Keeper::PushLindaStorage(*_linda, DestState{ L_ }) }; |
827 | if (_pushed == 0) { | 827 | if (_pushed == 0) { |
828 | // if the linda is empty, don't return nil | 828 | // if the linda is empty, don't return nil |
829 | _pushed = LindaToString<false>(L_, 1); | 829 | _pushed = LindaToString<false>(L_, 1); |