diff options
Diffstat (limited to 'src/LV2Features.cpp')
-rw-r--r-- | src/LV2Features.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/LV2Features.cpp b/src/LV2Features.cpp index 65fe6f6b..c33ba4c4 100644 --- a/src/LV2Features.cpp +++ b/src/LV2Features.cpp @@ -1,6 +1,6 @@ /* This file is part of Ingen. - Copyright 2007-2015 David Robillard <http://drobilla.net/> + Copyright 2007-2024 David Robillard <http://drobilla.net/> Ingen is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free @@ -14,10 +14,11 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#include "ingen/LV2Features.hpp" +#include <ingen/LV2Features.hpp> -#include "lv2/core/lv2.h" +#include <lv2/core/lv2.h> +#include <algorithm> #include <cstdlib> #include <memory> @@ -58,12 +59,9 @@ LV2Features::is_supported(const std::string& uri) const return true; } - for (const auto& f : _features) { - if (f->uri() == uri) { - return true; - } - } - return false; + return std::any_of(_features.begin(), + _features.end(), + [&uri](const auto& f) { return f->uri() == uri; }); } std::shared_ptr<LV2Features::FeatureArray> @@ -71,7 +69,7 @@ LV2Features::lv2_features(World& world, Node* node) const { FeatureArray::FeatureVector vec; for (const auto& f : _features) { - std::shared_ptr<LV2_Feature> fptr = f->feature(world, node); + const std::shared_ptr<LV2_Feature> fptr = f->feature(world, node); if (fptr) { vec.push_back(fptr); } |