mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-07 17:26:55 +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
|
#endif
|
||||||
|
|
||||||
std::vector<std::string> usepaths;
|
std::vector<std::string> usepaths;
|
||||||
usepaths.push_back("");
|
usepaths.emplace_back("");
|
||||||
if (usepath != nullptr)
|
if (usepath != nullptr)
|
||||||
{
|
{
|
||||||
usepaths.push_back(usepath);
|
usepaths.emplace_back(usepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> modulepaths;
|
std::vector<std::string> modulepaths;
|
||||||
std::vector<std::string> searchpaths = default_search_paths();
|
std::vector<std::string> searchpaths = default_search_paths();
|
||||||
modulepaths.insert(modulepaths.end(), searchpaths.begin(), searchpaths.end());
|
modulepaths.insert(modulepaths.end(), searchpaths.begin(), searchpaths.end());
|
||||||
modulepaths.push_back("");
|
modulepaths.emplace_back("");
|
||||||
if (modulepath != nullptr)
|
if (modulepath != nullptr)
|
||||||
{
|
{
|
||||||
modulepaths.push_back(modulepath);
|
modulepaths.emplace_back(modulepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
chaiscript::ChaiScript_Basic chai(create_chaiscript_stdlib(),create_chaiscript_parser(),modulepaths,usepaths);
|
chaiscript::ChaiScript_Basic chai(create_chaiscript_stdlib(),create_chaiscript_parser(),modulepaths,usepaths);
|
||||||
|
|||||||
@ -53,10 +53,10 @@ int main()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::vector<std::string> usepaths;
|
std::vector<std::string> usepaths;
|
||||||
usepaths.push_back("");
|
usepaths.emplace_back("");
|
||||||
if (usepath)
|
if (usepath)
|
||||||
{
|
{
|
||||||
usepaths.push_back(usepath);
|
usepaths.emplace_back(usepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> modulepaths;
|
std::vector<std::string> modulepaths;
|
||||||
@ -64,10 +64,10 @@ int main()
|
|||||||
#ifdef CHAISCRIPT_NO_DYNLOAD
|
#ifdef CHAISCRIPT_NO_DYNLOAD
|
||||||
chaiscript::ChaiScript chai(/* unused */modulepaths, usepaths);
|
chaiscript::ChaiScript chai(/* unused */modulepaths, usepaths);
|
||||||
#else
|
#else
|
||||||
modulepaths.push_back("");
|
modulepaths.emplace_back("");
|
||||||
if (modulepath)
|
if (modulepath)
|
||||||
{
|
{
|
||||||
modulepaths.push_back(modulepath);
|
modulepaths.emplace_back(modulepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
// For this test we are going to load the dynamic stdlib
|
// For this test we are going to load the dynamic stdlib
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user