diff options
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/BlockFactory.cpp | 16 | ||||
-rw-r--r-- | src/server/CompiledGraph.cpp | 14 | ||||
-rw-r--r-- | src/server/Engine.cpp | 13 |
3 files changed, 20 insertions, 23 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, diff --git a/src/server/CompiledGraph.cpp b/src/server/CompiledGraph.cpp index a89623d0..73468481 100644 --- a/src/server/CompiledGraph.cpp +++ b/src/server/CompiledGraph.cpp @@ -1,6 +1,6 @@ /* This file is part of Ingen. - Copyright 2015-2017 David Robillard <http://drobilla.net/> + Copyright 2015-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 @@ -61,13 +61,11 @@ public: static bool has_provider_with_many_dependants(const BlockImpl* n) { - for (const auto* p : n->providers()) { - if (p->dependants().size() > 1) { - return true; - } - } - - return false; + return std::any_of(n->providers().begin(), + n->providers().end(), + [](const auto* p) { + return p->dependants().size() > 1; + }); } CompiledGraph::CompiledGraph(GraphImpl* graph) diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp index cc3012d4..c9921889 100644 --- a/src/server/Engine.cpp +++ b/src/server/Engine.cpp @@ -1,6 +1,6 @@ /* This file is part of Ingen. - Copyright 2007-2017 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 @@ -239,12 +239,11 @@ Engine::emit_notifications(FrameTime end) bool Engine::pending_notifications() { - for (const auto& ctx : _run_contexts) { - if (ctx->pending_notifications()) { - return true; - } - } - return false; + return std::any_of(_run_contexts.begin(), + _run_contexts.end(), + [](const auto& ctx) { + return ctx->pending_notifications(); + }); } bool |