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,13 +165,12 @@ void QGlobalCache::LoadByGlobalContext()
LoadBy(query);
}
void QGlobalCache::LoadBy(const std::string query)
void QGlobalCache::LoadBy(const std::string &query)
{
auto results = database.QueryDatabase(query);
if (!results.Success())
return;
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));
auto results = database.QueryDatabase(query);
if (!results.Success())
return;
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));
}

View File

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