summaryrefslogtreecommitdiffstats
path: root/src/client
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/client
parent676651dea6c22895b0bc8de18d724d716089d798 (diff)
downloadingen-387e4faee9548a21f71a678f9e2730f6d5a307df.tar.gz
ingen-387e4faee9548a21f71a678f9e2730f6d5a307df.tar.bz2
ingen-387e4faee9548a21f71a678f9e2730f6d5a307df.zip
Use std::any_of()
Diffstat (limited to 'src/client')
-rw-r--r--src/client/PortModel.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp
index 48d70774..46129875 100644
--- a/src/client/PortModel.cpp
+++ b/src/client/PortModel.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
@@ -22,11 +22,11 @@
#include "ingen/client/ObjectModel.hpp"
#include "lv2/urid/urid.h"
+#include <algorithm>
#include <cstdint>
#include <exception>
#include <map>
#include <memory>
-#include <utility>
namespace ingen::client {
@@ -61,14 +61,12 @@ PortModel::port_property(const URIs::Quark& uri) const
bool
PortModel::is_uri() const
{
- // FIXME: Resource::has_property doesn't work, URI != URID
- for (const auto& p : properties()) {
- if (p.second.type() == _uris.atom_URID &&
- static_cast<LV2_URID>(p.second.get<int32_t>()) == _uris.atom_URID) {
- return true;
- }
- }
- return false;
+ return std::any_of(
+ properties().begin(), properties().end(), [this](const auto& p) {
+ return (p.second.type() == _uris.atom_URID &&
+ static_cast<LV2_URID>(p.second.template get<int32_t>()) ==
+ _uris.atom_URID);
+ });
}
void