From d9d555195e93d71755e15e3e0c27790a70923cb7 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 1 Nov 2020 19:53:38 -0800 Subject: [PATCH] clang-tidy: use emplace_back Found with modernize-use-emplace Signed-off-by: Rosen Penev --- include/cxxopts.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index 6ec7998..78457f3 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -1923,7 +1923,7 @@ OptionParser::parse(int argc, const char* const* argv) } else { - unmatched.push_back(argv[current]); + unmatched.emplace_back(argv[current]); } //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) { // keep unrecognised options in argument list, skip to next argument - unmatched.push_back(argv[current]); + unmatched.emplace_back(argv[current]); ++current; continue; } @@ -2031,7 +2031,7 @@ OptionParser::parse(int argc, const char* const* argv) //adjust argv for any that couldn't be swallowed while (current != argc) { - unmatched.push_back(argv[current]); + unmatched.emplace_back(argv[current]); ++current; } }