Просмотр исходного кода

core/reporter: Allow moves into SaveToFile()

Taking the json instance as a constant reference, makes all moves into
the parameter non-functional, resulting in copies. Taking it by value
allows moves to function.
Lioncash 7 лет назад
Родитель
Сommit
48807e9a24
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/core/reporter.cpp

+ 1 - 1
src/core/reporter.cpp

@@ -34,7 +34,7 @@ std::string GetTimestamp() {
 
 using namespace nlohmann;
 
-void SaveToFile(const json& json, const std::string& filename) {
+void SaveToFile(json json, const std::string& filename) {
     if (!FileUtil::CreateFullPath(filename)) {
         LOG_ERROR(Core, "Failed to create path for '{}' to save report!", filename);
         return;