From 61470d7820a5536abe7513cff81484ecdf61b7ea Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 6 Jun 2015 10:51:32 -0400 Subject: [PATCH] CLI: Cleaned up overly complex use of 'terminated'. --- src/CLI.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/CLI.cpp b/src/CLI.cpp index dfda2ac68..221b1ed71 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -250,16 +250,14 @@ void CLI::getDataLocation (int argc, const char** argv, Path& data) if (location != "") data = location; - bool terminated = false; for (int i = 0; i < argc; ++i) { std::string raw = argv[i]; if (raw == "--") - terminated = true; + break; - if (! terminated && - raw.length () > 17 && + if (raw.length () > 17 && raw.substr (0, 16) == "rc.data.location") { data = Directory (raw.substr (17)); @@ -274,16 +272,14 @@ void CLI::getDataLocation (int argc, const char** argv, Path& data) //////////////////////////////////////////////////////////////////////////////// void CLI::applyOverrides (int argc, const char** argv) { - bool terminated = false; for (int i = 0; i < argc; ++i) { std::string raw = argv[i]; if (raw == "--") - terminated = true; + break; - if (! terminated && - raw.length () > 3 && + if (raw.length () > 3 && raw.substr (0, 3) == "rc.") { auto sep = raw.find ('=', 3);