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;
|
||||
|
||||
auto it = _entries.begin();
|
||||
auto end = _entries.end();
|
||||
for (; it != end && it->name != type; ++it)
|
||||
;
|
||||
|
||||
if (it == end) {
|
||||
const auto it = absl::c_find_if(_entries, [&](auto&& entry) { return entry.name == type; });
|
||||
if (it == _entries.end()) {
|
||||
DBG("Unsupported effect type: " << type);
|
||||
return std::make_unique<sfz::fx::Nothing>();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue