diff --git a/src/main.cpp b/src/main.cpp index 392ce82..d4602c8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -243,10 +243,10 @@ static std::vector> get_params(int argc, char* argv[]) if ((arg.size() > 2) && (arg[0] == '-') && (arg[1] == '-')) { // Store the parameter name without the "--" prefix arg.remove_prefix(2); - args.emplace_back(std::vector(1, std::string(arg))); + args.emplace_back().emplace_back(arg); } else if (!args.empty()) { - args.back().emplace_back(std::string(arg)); + args.back().emplace_back(arg); } } diff --git a/src/util.cpp b/src/util.cpp index 846b6cd..fb46765 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1073,7 +1073,7 @@ std::vector> parse_config(const std::string& file_name) case BEFORE_NAME: if (is_alpha(c)) { state = NAME; - args.emplace_back(std::vector(1, std::string(1, c))); + args.emplace_back().emplace_back(1, c); } else if (c == '#') { state = COMMENT; @@ -1103,10 +1103,10 @@ std::vector> parse_config(const std::string& file_name) state = VALUE; quoted = (c == '"'); if (quoted) { - args.back().emplace_back(std::string()); + args.back().emplace_back(); } else { - args.back().emplace_back(std::string(1, c)); + args.back().emplace_back(1, c); } } break;