diff --git a/src/flat-database.h b/src/flat-database.h index 31938eee24..e36f9f7585 100644 --- a/src/flat-database.h +++ b/src/flat-database.h @@ -117,9 +117,9 @@ private: } - unsigned char pchMsgTmp[4]; - std::string strMagicMessageTmp; try { + unsigned char pchMsgTmp[4]; + std::string strMagicMessageTmp; // de-serialize file header (file specific magic message) and .. ssObj >> strMagicMessageTmp; @@ -178,11 +178,11 @@ private: } public: - CFlatDB(std::string strFilenameIn, std::string strMagicMessageIn) + CFlatDB(std::string&& strFilenameIn, std::string&& strMagicMessageIn) : + pathDB{gArgs.GetDataDirNet() / strFilenameIn}, + strFilename{strFilenameIn}, + strMagicMessage{strMagicMessageIn} { - pathDB = gArgs.GetDataDirNet() / strFilenameIn; - strFilename = strFilenameIn; - strMagicMessage = strMagicMessageIn; } bool Load(T& objToLoad) @@ -191,7 +191,7 @@ public: return Read(objToLoad); } - bool Store(T& objToSave) + bool Store(const T& objToSave) { LogPrintf("Verifying %s format...\n", strFilename); T tmpObjToLoad; diff --git a/src/governance/classes.cpp b/src/governance/classes.cpp index 43270d509a..e26d412e0d 100644 --- a/src/governance/classes.cpp +++ b/src/governance/classes.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include