mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Misc: reduced amount of string memory allocations (Step II)
This commit is contained in:
@@ -117,7 +117,7 @@ std::string gettablename(std::string &str)
|
||||
return str.substr(s, e-s);
|
||||
}
|
||||
|
||||
bool changenth(std::string &str, int n, const char *with, bool insert = false, bool nonzero = false)
|
||||
bool changenth(std::string &str, int n, char const* with, bool insert = false, bool nonzero = false)
|
||||
{
|
||||
std::string::size_type s, e;
|
||||
if (!findnth(str, n, s, e))
|
||||
@@ -142,7 +142,7 @@ std::string getnth(std::string &str, int n)
|
||||
return str.substr(s, e-s);
|
||||
}
|
||||
|
||||
bool changetoknth(std::string &str, int n, const char *with, bool insert = false, bool nonzero = false)
|
||||
bool changetoknth(std::string &str, int n, char const* with, bool insert = false, bool nonzero = false)
|
||||
{
|
||||
std::string::size_type s = 0, e = 0;
|
||||
if (!findtoknth(str, n, s, e))
|
||||
@@ -198,7 +198,7 @@ std::string CreateDumpString(char const* tableName, QueryResult result)
|
||||
{
|
||||
if (!tableName || !result) return "";
|
||||
std::ostringstream ss;
|
||||
ss << "INSERT INTO "<< _TABLE_SIM_ << tableName << _TABLE_SIM_ << " VALUES (";
|
||||
ss << "INSERT INTO " << _TABLE_SIM_ << tableName << _TABLE_SIM_ << " VALUES (";
|
||||
Field* fields = result->Fetch();
|
||||
for (uint32 i = 0; i < result->GetFieldCount(); ++i)
|
||||
{
|
||||
@@ -395,7 +395,7 @@ void fixNULLfields(std::string &line)
|
||||
}
|
||||
}
|
||||
|
||||
DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, std::string name, uint32 guid)
|
||||
DumpReturn PlayerDumpReader::LoadDump(std::string const& file, uint32 account, std::string name, uint32 guid)
|
||||
{
|
||||
uint32 charcount = AccountMgr::GetCharactersCount(account);
|
||||
if (charcount >= 10)
|
||||
|
||||
Reference in New Issue
Block a user