diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 90b69881cc..b91911c039 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -1360,7 +1360,7 @@ void Application::addImportType(const char* Type, const char* ModuleName) std::string::size_type next = item.filter.find_first_of(" )", pos+1); std::string::size_type len = next-pos-2; std::string type = item.filter.substr(pos+2,len); - item.types.push_back(type); + item.types.push_back(std::move(type)); pos = item.filter.find("*.", next); } @@ -1368,12 +1368,12 @@ void Application::addImportType(const char* Type, const char* ModuleName) if (strncmp(Type, "FreeCAD", 7) == 0) { std::string AppName = Config()["ExeName"]; AppName += item.filter.substr(7); - item.filter = AppName; + item.filter = std::move(AppName); // put to the front of the array - _mImportTypes.insert(_mImportTypes.begin(),item); + _mImportTypes.insert(_mImportTypes.begin(),std::move(item)); } else { - _mImportTypes.push_back(item); + _mImportTypes.push_back(std::move(item)); } } @@ -1483,7 +1483,7 @@ void Application::addExportType(const char* Type, const char* ModuleName) std::string::size_type next = item.filter.find_first_of(" )", pos+1); std::string::size_type len = next-pos-2; std::string type = item.filter.substr(pos+2,len); - item.types.push_back(type); + item.types.push_back(std::move(type)); pos = item.filter.find("*.", next); } @@ -1491,12 +1491,12 @@ void Application::addExportType(const char* Type, const char* ModuleName) if (strncmp(Type, "FreeCAD", 7) == 0) { std::string AppName = Config()["ExeName"]; AppName += item.filter.substr(7); - item.filter = AppName; + item.filter = std::move(AppName); // put to the front of the array - _mExportTypes.insert(_mExportTypes.begin(),item); + _mExportTypes.insert(_mExportTypes.begin(),std::move(item)); } else { - _mExportTypes.push_back(item); + _mExportTypes.push_back(std::move(item)); } } @@ -1665,7 +1665,7 @@ void Application::slotBeforeRecompute(const Document& doc) void Application::slotOpenTransaction(const Document& d, string s) { - this->signalOpenTransaction(d, s); + this->signalOpenTransaction(d, std::move(s)); } void Application::slotCommitTransaction(const Document& d) @@ -1743,7 +1743,7 @@ void Application::destruct() // now save all other parameter files auto& paramMgr = _pcSingleton->mpcPramManager; - for (auto it : paramMgr) { + for (const auto &it : paramMgr) { if ((it.second != _pcSysParamMngr) && (it.second != _pcUserParamMngr)) { if (it.second->HasSerializer() && !it.second->IgnoreSave()) { Base::Console().Log("Saving %s...\n", it.first.c_str()); @@ -2449,7 +2449,7 @@ void processProgramOptions(const variables_map& vm, std::map(); - mConfig["SaveFile"] = file; + mConfig["SaveFile"] = vm["output"].as(); } if (vm.count("hidden")) { @@ -2519,7 +2518,7 @@ void processProgramOptions(const variables_map& vm, std::map Application::getCmdLineFiles() // getting file name std::ostringstream temp; temp << "OpenFile" << i; - - std::string file(mConfig[temp.str()]); - files.push_back(file); + files.emplace_back(mConfig[temp.str()]); } return files; @@ -3400,7 +3397,7 @@ void Application::ExtractUserPath() // Set the default macro directory // - std::vector macrodirs = subdirs; + std::vector macrodirs = std::move(subdirs); // Last use in this method, just move macrodirs.emplace_back("Macro"); std::filesystem::path macro = findPath(dataHome, customData, macrodirs, true); mConfig["UserMacroPath"] = Base::FileInfo::pathToString(macro) + PATHSEP;