From 13e995b811e80dc48c0769274d3dca3a2221b843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Thu, 17 Aug 2017 23:02:50 +0200 Subject: Modernize src/c* src/d* and src/e* files (#6263) * Modernize src/c* src/d* and src/e* files * default operator * redundant init * delete default constructors on CraftDefinition childs (never used) * fix some missing init values * const ref fix reported by clang-tidy * ranged-based for loops * simple conditions & returns * empty stl function instead of size * emplace_back stl function instead of push_back + construct temp obj * auto for some iterators * code style fixes * c++ stl headers instead of C stl headers (stdio.h -> cstdio) --- src/database-sqlite3.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/database-sqlite3.cpp') diff --git a/src/database-sqlite3.cpp b/src/database-sqlite3.cpp index 77451fadb..78c182f86 100644 --- a/src/database-sqlite3.cpp +++ b/src/database-sqlite3.cpp @@ -521,10 +521,10 @@ void PlayerDatabaseSQLite3::savePlayer(RemotePlayer *player) sqlite3_reset(m_stmt_player_metadata_remove); const PlayerAttributes &attrs = sao->getExtendedAttributes(); - for (PlayerAttributes::const_iterator it = attrs.begin(); it != attrs.end(); ++it) { + for (const auto &attr : attrs) { str_to_sqlite(m_stmt_player_metadata_add, 1, player->getName()); - str_to_sqlite(m_stmt_player_metadata_add, 2, it->first); - str_to_sqlite(m_stmt_player_metadata_add, 3, it->second); + str_to_sqlite(m_stmt_player_metadata_add, 2, attr.first); + str_to_sqlite(m_stmt_player_metadata_add, 3, attr.second); sqlite3_vrfy(sqlite3_step(m_stmt_player_metadata_add), SQLITE_DONE); sqlite3_reset(m_stmt_player_metadata_add); } -- cgit v1.2.3