QGlobalCache::LoadBy to pass by reference

This commit is contained in:
Michael Cook (mackal) 2014-09-15 20:11:56 -04:00
parent e9f6031936
commit ec0989454d
2 changed files with 7 additions and 8 deletions

View File

@ -165,7 +165,7 @@ void QGlobalCache::LoadByGlobalContext()
LoadBy(query); LoadBy(query);
} }
void QGlobalCache::LoadBy(const std::string query) void QGlobalCache::LoadBy(const std::string &query)
{ {
auto results = database.QueryDatabase(query); auto results = database.QueryDatabase(query);
if (!results.Success()) if (!results.Success())
@ -173,5 +173,4 @@ void QGlobalCache::LoadBy(const std::string query)
for (auto row = results.begin(); row != results.end(); ++row) for (auto row = results.begin(); row != results.end(); ++row)
AddGlobal(0, QGlobal(std::string(row[0]), atoi(row[1]), atoi(row[2]), atoi(row[3]), row[4], row[5]? atoi(row[5]): 0xFFFFFFFF)); AddGlobal(0, QGlobal(std::string(row[0]), atoi(row[1]), atoi(row[2]), atoi(row[3]), row[4], row[5]? atoi(row[5]): 0xFFFFFFFF));
} }

View File

@ -42,7 +42,7 @@ public:
void LoadByZoneID(uint32 zoneID); //zone void LoadByZoneID(uint32 zoneID); //zone
void LoadByGlobalContext(); //zone void LoadByGlobalContext(); //zone
protected: protected:
void LoadBy(const std::string query); void LoadBy(const std::string &query);
std::list<QGlobal> qGlobalBucket; std::list<QGlobal> qGlobalBucket;
}; };