summaryrefslogtreecommitdiffstats
path: root/src/server/BlockFactory.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-10-06 16:40:23 -0400
committerDavid Robillard <d@drobilla.net>2024-10-11 19:58:27 -0400
commit387e4faee9548a21f71a678f9e2730f6d5a307df (patch)
tree3ed0e418e86eb6c1b1cb623d4e0de5653d1f9427 /src/server/BlockFactory.cpp
parent676651dea6c22895b0bc8de18d724d716089d798 (diff)
downloadingen-387e4faee9548a21f71a678f9e2730f6d5a307df.tar.gz
ingen-387e4faee9548a21f71a678f9e2730f6d5a307df.tar.bz2
ingen-387e4faee9548a21f71a678f9e2730f6d5a307df.zip
Use std::any_of()
Diffstat (limited to 'src/server/BlockFactory.cpp')
-rw-r--r--src/server/BlockFactory.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/server/BlockFactory.cpp b/src/server/BlockFactory.cpp
index 87ef4a9c..124a0f61 100644
--- a/src/server/BlockFactory.cpp
+++ b/src/server/BlockFactory.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
@@ -188,13 +188,13 @@ BlockFactory::load_lv2_plugins()
const uint32_t n_ports = lilv_plugin_get_num_ports(lv2_plug);
for (uint32_t p = 0; p < n_ports; ++p) {
const LilvPort* port = lilv_plugin_get_port_by_index(lv2_plug, p);
- supported = false;
- for (const auto& t : types) {
- if (lilv_port_is_a(lv2_plug, port, t.get())) {
- supported = true;
- break;
- }
- }
+ supported =
+ std::any_of(types.begin(),
+ types.end(),
+ [&lv2_plug, &port](const auto& t) {
+ return lilv_port_is_a(lv2_plug, port, t.get());
+ });
+
if (!supported &&
!lilv_port_has_property(lv2_plug,
port,