Use any_of instead of a range-based loop in the Argument::is function
This commit is contained in:
parent
58f2d9cba7
commit
24d934caf2
|
@ -37,12 +37,9 @@ public:
|
||||||
protected:
|
protected:
|
||||||
bool is(string_view str) override {
|
bool is(string_view str) override {
|
||||||
if (str.find_last_of('=') != string_view::npos && !str.empty()) {
|
if (str.find_last_of('=') != string_view::npos && !str.empty()) {
|
||||||
if (values.empty()) isValid: return str.starts_with("--" + longVersion + '=');
|
return (((values.empty()) ? str.starts_with("--" + longVersion + '=') : any_of(values.begin(), values.end(), [&str](const auto& value){
|
||||||
for (const auto& value: values) {
|
return str.ends_with(value.substr(1, value.size()));
|
||||||
if (str.ends_with(value.substr(1, value.size()))) {
|
})));
|
||||||
goto isValid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue