diff options
Diffstat (limited to 'src/keeper.cpp')
-rw-r--r-- | src/keeper.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/keeper.cpp b/src/keeper.cpp index e7574ed..d99cc50 100644 --- a/src/keeper.cpp +++ b/src/keeper.cpp | |||
@@ -139,7 +139,9 @@ void KeyUD::peek(KeeperState const K_, int const count_) | |||
139 | // read <count_> value off the fifo | 139 | // read <count_> value off the fifo |
140 | prepareAccess(K_, -1); // K_: fifo | 140 | prepareAccess(K_, -1); // K_: fifo |
141 | int const _at{ lua_gettop(K_) }; | 141 | int const _at{ lua_gettop(K_) }; |
142 | for (int const _i : std::ranges::iota_view{ 1, std::min(count_, count) }) { // push val2 to valN | 142 | int const _count{ std::min(count_, count) }; |
143 | STACK_GROW(K_, _count); | ||
144 | for (int const _i : std::ranges::iota_view{ 1, _count }) { // push val2 to valN | ||
143 | lua_rawgeti(K_, 1, first + _i); // K_: fifo val2..N | 145 | lua_rawgeti(K_, 1, first + _i); // K_: fifo val2..N |
144 | } | 146 | } |
145 | lua_rawgeti(K_, 1, first); // push val1 // K_: fifo val2..N val1 | 147 | lua_rawgeti(K_, 1, first); // push val1 // K_: fifo val2..N val1 |