From f1e4a671dc524430cae0dc66fd774858842a3067 Mon Sep 17 00:00:00 2001 From: Sfan5 Date: Mon, 9 Sep 2013 18:44:50 +0200 Subject: [PATCH] Use STL containers instead of irr::core::list --- src/database-dummy.cpp | 2 +- src/database-dummy.h | 2 +- src/database-leveldb.cpp | 2 +- src/database-leveldb.h | 2 +- src/database-sqlite3.cpp | 2 +- src/database-sqlite3.h | 2 +- src/database.h | 4 ++-- src/map.cpp | 5 +---- 8 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/database-dummy.cpp b/src/database-dummy.cpp index 7a36a8944..9ca0e7328 100644 --- a/src/database-dummy.cpp +++ b/src/database-dummy.cpp @@ -139,7 +139,7 @@ MapBlock* Database_Dummy::loadBlock(v3s16 blockpos) return(NULL); } -void Database_Dummy::listAllLoadableBlocks(core::list &dst) +void Database_Dummy::listAllLoadableBlocks(std::list &dst) { for(std::map::iterator x = m_database.begin(); x != m_database.end(); ++x) { diff --git a/src/database-dummy.h b/src/database-dummy.h index 55b21532c..5a6921370 100644 --- a/src/database-dummy.h +++ b/src/database-dummy.h @@ -16,7 +16,7 @@ public: virtual void endSave(); virtual void saveBlock(MapBlock *block); virtual MapBlock* loadBlock(v3s16 blockpos); - virtual void listAllLoadableBlocks(core::list &dst); + virtual void listAllLoadableBlocks(std::list &dst); virtual int Initialized(void); ~Database_Dummy(); private: diff --git a/src/database-leveldb.cpp b/src/database-leveldb.cpp index e0ab4f090..cb0101a81 100644 --- a/src/database-leveldb.cpp +++ b/src/database-leveldb.cpp @@ -146,7 +146,7 @@ MapBlock* Database_LevelDB::loadBlock(v3s16 blockpos) return(NULL); } -void Database_LevelDB::listAllLoadableBlocks(core::list &dst) +void Database_LevelDB::listAllLoadableBlocks(std::list &dst) { leveldb::Iterator* it = m_database->NewIterator(leveldb::ReadOptions()); for (it->SeekToFirst(); it->Valid(); it->Next()) { diff --git a/src/database-leveldb.h b/src/database-leveldb.h index 40bd01f25..942992116 100644 --- a/src/database-leveldb.h +++ b/src/database-leveldb.h @@ -21,7 +21,7 @@ public: virtual void endSave(); virtual void saveBlock(MapBlock *block); virtual MapBlock* loadBlock(v3s16 blockpos); - virtual void listAllLoadableBlocks(core::list &dst); + virtual void listAllLoadableBlocks(std::list &dst); virtual int Initialized(void); ~Database_LevelDB(); private: diff --git a/src/database-sqlite3.cpp b/src/database-sqlite3.cpp index 69795a1f2..1ae4d7a4b 100644 --- a/src/database-sqlite3.cpp +++ b/src/database-sqlite3.cpp @@ -294,7 +294,7 @@ void Database_SQLite3::createDatabase() } -void Database_SQLite3::listAllLoadableBlocks(core::list &dst) +void Database_SQLite3::listAllLoadableBlocks(std::list &dst) { verifyDatabase(); diff --git a/src/database-sqlite3.h b/src/database-sqlite3.h index 83b0d2a55..80ba028a4 100644 --- a/src/database-sqlite3.h +++ b/src/database-sqlite3.h @@ -22,7 +22,7 @@ public: virtual void saveBlock(MapBlock *block); virtual MapBlock* loadBlock(v3s16 blockpos); - virtual void listAllLoadableBlocks(core::list &dst); + virtual void listAllLoadableBlocks(std::list &dst); virtual int Initialized(void); ~Database_SQLite3(); private: diff --git a/src/database.h b/src/database.h index b6d8950ba..337f2745a 100644 --- a/src/database.h +++ b/src/database.h @@ -8,7 +8,7 @@ #include "main.h" #include "filesys.h" #include "serialization.h" -#include +#include class Database; class ServerMap; @@ -23,7 +23,7 @@ public: virtual MapBlock* loadBlock(v3s16 blockpos)=0; long long getBlockAsInteger(const v3s16 pos); v3s16 getIntegerAsBlock(long long i); - virtual void listAllLoadableBlocks(core::list &dst)=0; + virtual void listAllLoadableBlocks(std::list &dst)=0; virtual int Initialized(void)=0; virtual ~Database() {}; }; diff --git a/src/map.cpp b/src/map.cpp index 7a5296bac..e2191f9e1 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -3371,10 +3371,7 @@ void ServerMap::listAllLoadableBlocks(std::list &dst) errorstream<<"Map::listAllLoadableBlocks(): Result will be missing " <<"all blocks that are stored in flat files"< dst_; - dbase->listAllLoadableBlocks(dst_); - for(core::list::Iterator i = dst_.begin(); i != dst_.end(); ++i) - dst.push_back(*i); + dbase->listAllLoadableBlocks(dst); } void ServerMap::listAllLoadedBlocks(std::list &dst) -- 2.25.1