diff --git a/src/main.cpp b/src/main.cpp index 7fbc1cb1..0c045c6e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -282,19 +282,19 @@ int main(int argc, char *argv[]) #endif std::vector usepaths; - usepaths.push_back(""); + usepaths.emplace_back(""); if (usepath != nullptr) { - usepaths.push_back(usepath); + usepaths.emplace_back(usepath); } std::vector modulepaths; std::vector searchpaths = default_search_paths(); modulepaths.insert(modulepaths.end(), searchpaths.begin(), searchpaths.end()); - modulepaths.push_back(""); + modulepaths.emplace_back(""); if (modulepath != nullptr) { - modulepaths.push_back(modulepath); + modulepaths.emplace_back(modulepath); } chaiscript::ChaiScript_Basic chai(create_chaiscript_stdlib(),create_chaiscript_parser(),modulepaths,usepaths); diff --git a/unittests/multithreaded_test.cpp b/unittests/multithreaded_test.cpp index e2d0240b..9241f743 100644 --- a/unittests/multithreaded_test.cpp +++ b/unittests/multithreaded_test.cpp @@ -53,10 +53,10 @@ int main() #endif std::vector usepaths; - usepaths.push_back(""); + usepaths.emplace_back(""); if (usepath) { - usepaths.push_back(usepath); + usepaths.emplace_back(usepath); } std::vector modulepaths; @@ -64,10 +64,10 @@ int main() #ifdef CHAISCRIPT_NO_DYNLOAD chaiscript::ChaiScript chai(/* unused */modulepaths, usepaths); #else - modulepaths.push_back(""); + modulepaths.emplace_back(""); if (modulepath) { - modulepaths.push_back(modulepath); + modulepaths.emplace_back(modulepath); } // For this test we are going to load the dynamic stdlib