From 3af246bb3291d8568f6d110884fa55ee5fd20221 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 18 Aug 2022 01:22:18 -0400 Subject: Avoid "else" after "return", "break", and "continue" --- src/Configuration.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/Configuration.cpp') diff --git a/src/Configuration.cpp b/src/Configuration.cpp index 8fe12c79..794cf193 100644 --- a/src/Configuration.cpp +++ b/src/Configuration.cpp @@ -109,9 +109,12 @@ Configuration::variable_string(LV2_URID type) const { if (type == _forge.String) { return "=STRING"; - } else if (type == _forge.Int) { + } + + if (type == _forge.Int) { return "=INT"; } + return ""; } @@ -186,7 +189,9 @@ Configuration::parse(int argc, char** argv) const auto o = _options.find(name); if (o == _options.end()) { throw OptionError(fmt("Unrecognized option `%1%'", name)); - } else if (o->second.type == _forge.Bool) { // --flag + } + + if (o->second.type == _forge.Bool) { // --flag o->second.value = _forge.make(true); } else if (equals) { // --opt=val set_value_from_string(o->second, equals + 1); @@ -379,9 +384,9 @@ Configuration::option(const std::string& long_name) const auto o = _options.find(long_name); if (o == _options.end()) { return nil; - } else { - return o->second.value; } + + return o->second.value; } bool -- cgit v1.2.1