diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-05-16 18:57:36 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-05-16 18:57:36 +0300 |
commit | 16933c951386a563971149d2beb3dc2147a0db8e (patch) | |
tree | b458a9e2efdb37f7998c9e5e1e0970dcaa8eddd1 /src/cmd_line.cpp | |
parent | remove VS 2013 cruft (diff) | |
download | winapi-common-16933c951386a563971149d2beb3dc2147a0db8e.tar.gz winapi-common-16933c951386a563971149d2beb3dc2147a0db8e.zip |
clang-tidy fixes
Diffstat (limited to 'src/cmd_line.cpp')
-rw-r--r-- | src/cmd_line.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/cmd_line.cpp b/src/cmd_line.cpp index 3fc0a7e..4c8afb0 100644 --- a/src/cmd_line.cpp +++ b/src/cmd_line.cpp @@ -57,7 +57,7 @@ std::string split_argv0(std::vector<std::string>& argv) { if (argv.empty()) { throw std::range_error{"argv must contain at least one element"}; } - const auto argv0 = argv[0]; + auto argv0 = argv[0]; argv.erase(argv.begin()); return argv0; } @@ -86,11 +86,7 @@ CommandLine CommandLine::from_main(int argc, wchar_t* argv[]) { return CommandLine{narrow_all(argc, argv)}; } -CommandLine::CommandLine(const std::vector<std::string>& argv) : m_args{argv} { - m_argv0 = split_argv0(m_args); -} - -CommandLine::CommandLine(std::vector<std::string>&& argv) : m_args{std::move(argv)} { +CommandLine::CommandLine(std::vector<std::string> argv) : m_args{std::move(argv)} { m_argv0 = split_argv0(m_args); } |