Use a goto statement in the Argument::is function
This commit is contained in:
parent
2de8ce3e43
commit
471a588d37
|
@ -37,11 +37,10 @@ public:
|
|||
protected:
|
||||
bool is(string_view str) override {
|
||||
if (str.find_last_of('=') != string_view::npos && !str.empty()) {
|
||||
auto isValid = [&]() -> bool { return str.starts_with("--" + longVersion + '='); };
|
||||
if (values.empty()) return isValid();
|
||||
if (values.empty()) isValid: return str.starts_with("--" + longVersion + '=');
|
||||
for (const auto& value : values) {
|
||||
if (str.ends_with(value.substr(1, value.size()))) {
|
||||
return isValid();
|
||||
goto isValid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue