diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-07 10:39:04 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-07 10:39:04 +0200 |
commit | 867a65c0046848bc5e6867ae76f16db293ba4101 (patch) | |
tree | 8586aa4c116e75c21b91ce95d6560b8b14f15ef9 /src/keeper.cpp | |
parent | 03cb6d50e4943e88bc634c1b0315b05b12cf92fa (diff) | |
download | lanes-867a65c0046848bc5e6867ae76f16db293ba4101.tar.gz lanes-867a65c0046848bc5e6867ae76f16db293ba4101.tar.bz2 lanes-867a65c0046848bc5e6867ae76f16db293ba4101.zip |
Code boyscouting
Diffstat (limited to 'src/keeper.cpp')
-rw-r--r-- | src/keeper.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/keeper.cpp b/src/keeper.cpp index 3e806f9..b8f2bd0 100644 --- a/src/keeper.cpp +++ b/src/keeper.cpp | |||
@@ -276,7 +276,7 @@ static void PushKeysDB(KeeperState const K_, int const idx_) | |||
276 | int keeper_push_linda_storage(Linda& linda_, DestState L_) | 276 | int keeper_push_linda_storage(Linda& linda_, DestState L_) |
277 | { | 277 | { |
278 | Keeper* const _keeper{ linda_.whichKeeper() }; | 278 | Keeper* const _keeper{ linda_.whichKeeper() }; |
279 | KeeperState const _K{ _keeper ? _keeper->L : nullptr }; | 279 | KeeperState const _K{ _keeper ? _keeper->K : nullptr }; |
280 | if (_K == nullptr) { | 280 | if (_K == nullptr) { |
281 | return 0; | 281 | return 0; |
282 | } | 282 | } |
@@ -710,7 +710,7 @@ void Keeper::operator delete[](void* p_, Universe* U_) | |||
710 | // ################################################################################################# | 710 | // ################################################################################################# |
711 | // ################################################################################################# | 711 | // ################################################################################################# |
712 | 712 | ||
713 | void Keepers::DeleteKV::operator()(Keeper* k_) const | 713 | void Keepers::DeleteKV::operator()(Keeper* const k_) const |
714 | { | 714 | { |
715 | for (Keeper& _k : std::views::counted(k_, count)) { | 715 | for (Keeper& _k : std::views::counted(k_, count)) { |
716 | _k.~Keeper(); | 716 | _k.~Keeper(); |
@@ -733,7 +733,7 @@ void Keepers::close() | |||
733 | } | 733 | } |
734 | 734 | ||
735 | auto _closeOneKeeper = [](Keeper& keeper_) { | 735 | auto _closeOneKeeper = [](Keeper& keeper_) { |
736 | lua_State* const _K{ std::exchange(keeper_.L, KeeperState{ nullptr }) }; | 736 | lua_State* const _K{ std::exchange(keeper_.K, KeeperState{ nullptr }) }; |
737 | if (_K) { | 737 | if (_K) { |
738 | lua_close(_K); | 738 | lua_close(_K); |
739 | } | 739 | } |
@@ -824,7 +824,7 @@ void Keepers::initialize(Universe& U_, lua_State* L_, int const nbKeepers_, int | |||
824 | raise_luaL_error(L, "out of memory while creating keeper states"); | 824 | raise_luaL_error(L, "out of memory while creating keeper states"); |
825 | } | 825 | } |
826 | 826 | ||
827 | keeper_.L = _K; | 827 | keeper_.K = _K; |
828 | 828 | ||
829 | // Give a name to the state | 829 | // Give a name to the state |
830 | std::ignore = luaG_pushstringview(_K, "Keeper #%d", i_ + 1); // L_: settings _K: "Keeper #n" | 830 | std::ignore = luaG_pushstringview(_K, "Keeper #%d", i_ + 1); // L_: settings _K: "Keeper #n" |