diff options
author | David Robillard <d@drobilla.net> | 2024-10-06 16:40:23 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-10-11 19:58:27 -0400 |
commit | 387e4faee9548a21f71a678f9e2730f6d5a307df (patch) | |
tree | 3ed0e418e86eb6c1b1cb623d4e0de5653d1f9427 /src/LV2Features.cpp | |
parent | 676651dea6c22895b0bc8de18d724d716089d798 (diff) | |
download | ingen-387e4faee9548a21f71a678f9e2730f6d5a307df.tar.gz ingen-387e4faee9548a21f71a678f9e2730f6d5a307df.tar.bz2 ingen-387e4faee9548a21f71a678f9e2730f6d5a307df.zip |
Use std::any_of()
Diffstat (limited to 'src/LV2Features.cpp')
-rw-r--r-- | src/LV2Features.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/LV2Features.cpp b/src/LV2Features.cpp index 7d9003c0..5cdeca44 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 @@ -18,6 +18,7 @@ #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> |