aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Tools
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2012-10-24 15:34:23 +0200
committerSpp <spp@jorge.gr>2012-10-24 15:34:48 +0200
commit9fbc4c0ae2acab3ceba717b33c72e2382a1e5bb8 (patch)
tree2190f494bc8830b8a695c5fcad612e4d0c350fee /src/server/game/Tools
parent013fb1f4d9131fc8ec45931445e6a05408dce8f9 (diff)
Core/Misc: reduced amount of string memory allocations (Step II)
Diffstat (limited to 'src/server/game/Tools')
-rw-r--r--src/server/game/Tools/PlayerDump.cpp8
-rwxr-xr-xsrc/server/game/Tools/PlayerDump.h5
2 files changed, 6 insertions, 7 deletions
diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp
index ef516a0ba4f..ec7d2e08001 100644
--- a/src/server/game/Tools/PlayerDump.cpp
+++ b/src/server/game/Tools/PlayerDump.cpp
@@ -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)
diff --git a/src/server/game/Tools/PlayerDump.h b/src/server/game/Tools/PlayerDump.h
index 6662d91fb31..321649fc485 100755
--- a/src/server/game/Tools/PlayerDump.h
+++ b/src/server/game/Tools/PlayerDump.h
@@ -73,7 +73,7 @@ class PlayerDumpWriter : public PlayerDump
PlayerDumpWriter() {}
bool GetDump(uint32 guid, std::string& dump);
- DumpReturn WriteDump(const std::string& file, uint32 guid);
+ DumpReturn WriteDump(std::string const& file, uint32 guid);
private:
typedef std::set<uint32> GUIDs;
@@ -91,8 +91,7 @@ class PlayerDumpReader : public PlayerDump
public:
PlayerDumpReader() {}
- DumpReturn LoadDump(const std::string& file, uint32 account, std::string name, uint32 guid);
+ DumpReturn LoadDump(std::string const& file, uint32 account, std::string name, uint32 guid);
};
#endif
-