use find_if
This commit is contained in:
parent
7532291545
commit
70bc12f484
1 changed files with 2 additions and 6 deletions
|
|
@ -45,12 +45,8 @@ std::unique_ptr<Effect> EffectFactory::makeEffect(absl::Span<const Opcode> membe
|
||||||
|
|
||||||
absl::string_view type = opcode->value;
|
absl::string_view type = opcode->value;
|
||||||
|
|
||||||
auto it = _entries.begin();
|
const auto it = absl::c_find_if(_entries, [&](auto&& entry) { return entry.name == type; });
|
||||||
auto end = _entries.end();
|
if (it == _entries.end()) {
|
||||||
for (; it != end && it->name != type; ++it)
|
|
||||||
;
|
|
||||||
|
|
||||||
if (it == end) {
|
|
||||||
DBG("Unsupported effect type: " << type);
|
DBG("Unsupported effect type: " << type);
|
||||||
return std::make_unique<sfz::fx::Nothing>();
|
return std::make_unique<sfz::fx::Nothing>();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue