diff options
| author | ailurux <ailuruxx@gmail.com> | 2024-05-30 13:49:56 +1000 |
|---|---|---|
| committer | ailurux <ailuruxx@gmail.com> | 2024-05-30 13:49:56 +1000 |
| commit | 9dbcd6a5c8a9cb5c29867dd450b2af8934616f56 (patch) | |
| tree | 7160c02c623b311da496b651e61495d7ce0abb3a /src/tangara/lua/lua_database.cpp | |
| parent | 2ff8eac022f397bb1aed28aca376fbe422fc8b3c (diff) | |
| download | tangara-fw-9dbcd6a5c8a9cb5c29867dd450b2af8934616f56.tar.gz | |
Fix prev/next behaviour on database iterator
Fixes issue with apparent duplicated tracks in the infinite list
Diffstat (limited to 'src/tangara/lua/lua_database.cpp')
| -rw-r--r-- | src/tangara/lua/lua_database.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tangara/lua/lua_database.cpp b/src/tangara/lua/lua_database.cpp index 1afb01f0..bf84a399 100644 --- a/src/tangara/lua/lua_database.cpp +++ b/src/tangara/lua/lua_database.cpp @@ -162,7 +162,7 @@ static auto push_iterator(lua_State* state, static auto db_iterate_prev(lua_State* state) -> int { database::Iterator* it = db_check_iterator(state, 1); - std::optional<database::Record> res = (*it)--; + std::optional<database::Record> res = --(*it); if (res) { push_lua_record(state, *res); @@ -175,7 +175,7 @@ static auto db_iterate_prev(lua_State* state) -> int { static auto db_iterate(lua_State* state) -> int { database::Iterator* it = db_check_iterator(state, 1); - std::optional<database::Record> res = (*it)++; + std::optional<database::Record> res = ++(*it); if (res) { push_lua_record(state, *res); |
