mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-06 16:57:04 +08:00
replace std::vector::push_back with emplace_back
This commit is contained in:
parent
964a36bdcd
commit
52a9fa47c1
@ -282,19 +282,19 @@ int main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
std::vector<std::string> usepaths;
|
||||
usepaths.push_back("");
|
||||
usepaths.emplace_back("");
|
||||
if (usepath != nullptr)
|
||||
{
|
||||
usepaths.push_back(usepath);
|
||||
usepaths.emplace_back(usepath);
|
||||
}
|
||||
|
||||
std::vector<std::string> modulepaths;
|
||||
std::vector<std::string> 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);
|
||||
|
||||
@ -53,10 +53,10 @@ int main()
|
||||
#endif
|
||||
|
||||
std::vector<std::string> usepaths;
|
||||
usepaths.push_back("");
|
||||
usepaths.emplace_back("");
|
||||
if (usepath)
|
||||
{
|
||||
usepaths.push_back(usepath);
|
||||
usepaths.emplace_back(usepath);
|
||||
}
|
||||
|
||||
std::vector<std::string> 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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user