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/client | |
parent | 676651dea6c22895b0bc8de18d724d716089d798 (diff) | |
download | ingen-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.cpp | 18 |
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 |