diff options
author | DS <vorunbekannt75@web.de> | 2022-03-29 18:06:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-29 18:06:16 +0200 |
commit | 8d387433b14791db95e59127b5e6e30f58155c1e (patch) | |
tree | f7ce345cb892a6c9fdc0f210559e744c57e1f0d4 /src/database | |
parent | 0f25fa7af655b98fa401176a523f269c843d1943 (diff) | |
download | minetest-8d387433b14791db95e59127b5e6e30f58155c1e.tar.gz minetest-8d387433b14791db95e59127b5e6e30f58155c1e.tar.bz2 minetest-8d387433b14791db95e59127b5e6e30f58155c1e.zip |
Fix the documentation of InvRef:get_lists() and clean up code (#12150)
Diffstat (limited to 'src/database')
-rw-r--r-- | src/database/database-postgresql.cpp | 2 | ||||
-rw-r--r-- | src/database/database-sqlite3.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/database/database-postgresql.cpp b/src/database/database-postgresql.cpp index 3469f4242..9d6501e68 100644 --- a/src/database/database-postgresql.cpp +++ b/src/database/database-postgresql.cpp @@ -495,7 +495,7 @@ void PlayerDatabasePostgreSQL::savePlayer(RemotePlayer *player) execPrepared("remove_player_inventories", 1, rmvalues); execPrepared("remove_player_inventory_items", 1, rmvalues); - std::vector<const InventoryList*> inventory_lists = sao->getInventory()->getLists(); + const auto &inventory_lists = sao->getInventory()->getLists(); std::ostringstream oss; for (u16 i = 0; i < inventory_lists.size(); i++) { const InventoryList* list = inventory_lists[i]; diff --git a/src/database/database-sqlite3.cpp b/src/database/database-sqlite3.cpp index 1e63ae9d8..9521085e9 100644 --- a/src/database/database-sqlite3.cpp +++ b/src/database/database-sqlite3.cpp @@ -476,10 +476,10 @@ void PlayerDatabaseSQLite3::savePlayer(RemotePlayer *player) sqlite3_vrfy(sqlite3_step(m_stmt_player_remove_inventory_items), SQLITE_DONE); sqlite3_reset(m_stmt_player_remove_inventory_items); - std::vector<const InventoryList*> inventory_lists = sao->getInventory()->getLists(); + const auto &inventory_lists = sao->getInventory()->getLists(); std::ostringstream oss; for (u16 i = 0; i < inventory_lists.size(); i++) { - const InventoryList* list = inventory_lists[i]; + const InventoryList *list = inventory_lists[i]; str_to_sqlite(m_stmt_player_add_inventory, 1, player->getName()); int_to_sqlite(m_stmt_player_add_inventory, 2, i); |