Use STL containers instead of irr::core::list
authorSfan5 <sfan5@live.de>
Mon, 9 Sep 2013 16:44:50 +0000 (18:44 +0200)
committerSfan5 <sfan5@live.de>
Mon, 9 Sep 2013 20:50:51 +0000 (22:50 +0200)
src/database-dummy.cpp
src/database-dummy.h
src/database-leveldb.cpp
src/database-leveldb.h
src/database-sqlite3.cpp
src/database-sqlite3.h
src/database.h
src/map.cpp

index 7a36a8944544b0d7f7edfe2001fdf835d173e996..9ca0e732809d6766bedcb604720142e62811ee9c 100644 (file)
@@ -139,7 +139,7 @@ MapBlock* Database_Dummy::loadBlock(v3s16 blockpos)
        return(NULL);
 }
 
-void Database_Dummy::listAllLoadableBlocks(core::list<v3s16> &dst)
+void Database_Dummy::listAllLoadableBlocks(std::list<v3s16> &dst)
 {
        for(std::map<unsigned long long, std::string>::iterator x = m_database.begin(); x != m_database.end(); ++x)
        {
index 55b21532cdf9d4dd4d9133e7e3fd02e34e967b1b..5a6921370b46ab92f6894c77de0a0bf7e54c4146 100644 (file)
@@ -16,7 +16,7 @@ public:
        virtual void endSave();
         virtual void saveBlock(MapBlock *block);
         virtual MapBlock* loadBlock(v3s16 blockpos);
-        virtual void listAllLoadableBlocks(core::list<v3s16> &dst);
+        virtual void listAllLoadableBlocks(std::list<v3s16> &dst);
         virtual int Initialized(void);
        ~Database_Dummy();
 private:
index e0ab4f0902219919c0190f3ec86920a7c8a50137..cb0101a811f7ce46bb2f23d672b4b5e3c8bed86a 100644 (file)
@@ -146,7 +146,7 @@ MapBlock* Database_LevelDB::loadBlock(v3s16 blockpos)
        return(NULL);
 }
 
-void Database_LevelDB::listAllLoadableBlocks(core::list<v3s16> &dst)
+void Database_LevelDB::listAllLoadableBlocks(std::list<v3s16> &dst)
 {
        leveldb::Iterator* it = m_database->NewIterator(leveldb::ReadOptions());
        for (it->SeekToFirst(); it->Valid(); it->Next()) {
index 40bd01f253b06b2ff8331537b8c2ff0e44a3a7d9..942992116b11f1c5cf73a5ba404885d97b02ffa2 100644 (file)
@@ -21,7 +21,7 @@ public:
        virtual void endSave();
         virtual void saveBlock(MapBlock *block);
         virtual MapBlock* loadBlock(v3s16 blockpos);
-        virtual void listAllLoadableBlocks(core::list<v3s16> &dst);
+        virtual void listAllLoadableBlocks(std::list<v3s16> &dst);
         virtual int Initialized(void);
        ~Database_LevelDB();
 private:
index 69795a1f26c4676a3d39b2b8a05e757a34e5d81b..1ae4d7a4bc7cc757b256ec238938dbb1495e0ccb 100644 (file)
@@ -294,7 +294,7 @@ void Database_SQLite3::createDatabase()
        
 }
 
-void Database_SQLite3::listAllLoadableBlocks(core::list<v3s16> &dst)
+void Database_SQLite3::listAllLoadableBlocks(std::list<v3s16> &dst)
 {
        verifyDatabase();
        
index 83b0d2a55552b492e3fd93d844d584d63c6f3f28..80ba028a486b7156290e3ed2856e2f0030d41778 100644 (file)
@@ -22,7 +22,7 @@ public:
 
         virtual void saveBlock(MapBlock *block);
         virtual MapBlock* loadBlock(v3s16 blockpos);
-        virtual void listAllLoadableBlocks(core::list<v3s16> &dst);
+        virtual void listAllLoadableBlocks(std::list<v3s16> &dst);
         virtual int Initialized(void);
        ~Database_SQLite3();
 private:
index b6d8950baf2002f7348b32c5a5acc022fd9152d6..337f2745aed9ba2c0fbc45a4a0113ce6f73e279e 100644 (file)
@@ -8,7 +8,7 @@
 #include "main.h"
 #include "filesys.h"
 #include "serialization.h"
-#include <irrList.h>
+#include <list>
 
 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<v3s16> &dst)=0;
+       virtual void listAllLoadableBlocks(std::list<v3s16> &dst)=0;
        virtual int Initialized(void)=0;
        virtual ~Database() {};
 };
index 7a5296bacdf036dfe79c3c0fc6edda83ba0f1427..e2191f9e1b7c4a69cc5c85152cd4a3bee39b2580 100644 (file)
@@ -3371,10 +3371,7 @@ void ServerMap::listAllLoadableBlocks(std::list<v3s16> &dst)
                errorstream<<"Map::listAllLoadableBlocks(): Result will be missing "
                                <<"all blocks that are stored in flat files"<<std::endl;
        }
-       core::list<v3s16> dst_;
-       dbase->listAllLoadableBlocks(dst_);
-       for(core::list<v3s16>::Iterator i = dst_.begin(); i != dst_.end(); ++i)
-               dst.push_back(*i);
+       dbase->listAllLoadableBlocks(dst);
 }
 
 void ServerMap::listAllLoadedBlocks(std::list<v3s16> &dst)