From 46918cdbec59001d0c624210171b1d96d933c9e7 Mon Sep 17 00:00:00 2001 From: Arthur Ice Date: Mon, 3 Jun 2013 16:25:42 -0700 Subject: [PATCH] switched to reference rather than copy semantics for query on RunQuery --- common/dbcore.cpp | 2 +- common/dbcore.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/dbcore.cpp b/common/dbcore.cpp index 17cdca092..600fe11a6 100644 --- a/common/dbcore.cpp +++ b/common/dbcore.cpp @@ -59,7 +59,7 @@ void DBcore::ping() { MDatabase.unlock(); } -bool DBcore::RunQuery(const std::string query, char* errbuf, MYSQL_RES** result, uint32* affected_rows, uint32* last_insert_id, uint32* errnum, bool retry) { +bool DBcore::RunQuery(const std::string& query, char* errbuf, MYSQL_RES** result, uint32* affected_rows, uint32* last_insert_id, uint32* errnum, bool retry) { _CP(DBcore_RunQuery); if (errnum) *errnum = 0; diff --git a/common/dbcore.h b/common/dbcore.h index 51e0ee1a4..25e33fcf2 100644 --- a/common/dbcore.h +++ b/common/dbcore.h @@ -22,7 +22,7 @@ public: DBcore(); ~DBcore(); eStatus GetStatus() { return pStatus; } - bool RunQuery(const std::string query, char* errbuf = 0, MYSQL_RES** result = 0, uint32* affected_rows = 0, uint32* last_insert_id = 0, uint32* errnum = 0, bool retry = true); + bool RunQuery(const std::string& query, char* errbuf = 0, MYSQL_RES** result = 0, uint32* affected_rows = 0, uint32* last_insert_id = 0, uint32* errnum = 0, bool retry = true); void DoEscapeString(std::string& outString, const char* frombuf, uint32 fromlen); void ping(); MYSQL* getMySQL(){ return &mysql; }