From ed21ea8fc6d332b75970945c4935627ec5c0e59f Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 6 May 2022 01:19:06 +0200 Subject: [PATCH] Speed up valid-port changes O(n) -> O(log(n)) This significantly reduces DSP load of sessions with many ports when using debug builds. --- libs/ardour/ardour/port_engine_shared.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/ardour/ardour/port_engine_shared.h b/libs/ardour/ardour/port_engine_shared.h index d6782e317f..e193da37c9 100644 --- a/libs/ardour/ardour/port_engine_shared.h +++ b/libs/ardour/ardour/port_engine_shared.h @@ -230,7 +230,7 @@ protected: bool valid_port (BackendPortHandle port) const { boost::shared_ptr p = _ports.reader (); - return std::find (p->begin (), p->end (), port) != p->end (); + return p->find (port) != p->end (); } BackendPortPtr find_port (const std::string& port_name) const {