clang-tidy: use emplace_back

Found with modernize-use-emplace

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2020-11-01 19:53:38 -08:00
parent 66b52e6cc9
commit d9d555195e

View File

@ -1923,7 +1923,7 @@ OptionParser::parse(int argc, const char* const* argv)
} }
else else
{ {
unmatched.push_back(argv[current]); unmatched.emplace_back(argv[current]);
} }
//if we return from here then it was parsed successfully, so continue //if we return from here then it was parsed successfully, so continue
} }
@ -1978,7 +1978,7 @@ OptionParser::parse(int argc, const char* const* argv)
if (m_allow_unrecognised) if (m_allow_unrecognised)
{ {
// keep unrecognised options in argument list, skip to next argument // keep unrecognised options in argument list, skip to next argument
unmatched.push_back(argv[current]); unmatched.emplace_back(argv[current]);
++current; ++current;
continue; continue;
} }
@ -2031,7 +2031,7 @@ OptionParser::parse(int argc, const char* const* argv)
//adjust argv for any that couldn't be swallowed //adjust argv for any that couldn't be swallowed
while (current != argc) { while (current != argc) {
unmatched.push_back(argv[current]); unmatched.emplace_back(argv[current]);
++current; ++current;
} }
} }