diff options
author | MÃ¥rten Kongstad <marten.kongstad@sony.com> | 2018-11-29 08:23:14 +0100 |
---|---|---|
committer | Todd Kennedy <toddke@google.com> | 2018-12-21 08:16:09 -0800 |
commit | 0eba72a4dd3489a11af5ca93d0a2c334d486138b (patch) | |
tree | 65ce9130728ea1f6f8be0267226d4b43ad9ec210 /cmds/idmap2/libidmap2/CommandLineOptions.cpp | |
parent | 2527fa3abdba19698f08cfbb5344d05e535d2e4f (diff) |
idmap2: fix clang-tidy warnings [modernize-*]
Bug: 120024673
Test: mmm frameworks/base/cmds/idmap2; check output
Change-Id: I8768169fb7b541eb6b1aa3311c46a710eb71aac9
Diffstat (limited to 'cmds/idmap2/libidmap2/CommandLineOptions.cpp')
-rw-r--r-- | cmds/idmap2/libidmap2/CommandLineOptions.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/cmds/idmap2/libidmap2/CommandLineOptions.cpp b/cmds/idmap2/libidmap2/CommandLineOptions.cpp index 28c3797226e1..cabc8f398c46 100644 --- a/cmds/idmap2/libidmap2/CommandLineOptions.cpp +++ b/cmds/idmap2/libidmap2/CommandLineOptions.cpp @@ -26,13 +26,11 @@ #include "idmap2/CommandLineOptions.h" -namespace android { -namespace idmap2 { +namespace android::idmap2 { std::unique_ptr<std::vector<std::string>> CommandLineOptions::ConvertArgvToVector( int argc, const char** argv) { - return std::unique_ptr<std::vector<std::string>>( - new std::vector<std::string>(argv + 1, argv + argc)); + return std::make_unique<std::vector<std::string>>(argv + 1, argv + argc); } CommandLineOptions& CommandLineOptions::OptionalFlag(const std::string& name, @@ -111,8 +109,8 @@ bool CommandLineOptions::Parse(const std::vector<std::string>& argv, std::ostrea } if (!mandatory_opts.empty()) { - for (auto iter = mandatory_opts.cbegin(); iter != mandatory_opts.cend(); ++iter) { - outError << "error: " << *iter << ": missing mandatory option" << std::endl; + for (const auto& opt : mandatory_opts) { + outError << "error: " << opt << ": missing mandatory option" << std::endl; } Usage(outError); return false; @@ -159,5 +157,4 @@ void CommandLineOptions::Usage(std::ostream& out) const { } } -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 |