From 37c0fceeac0bf07931664ffbf7f1dc0b0a66682a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 6 May 2022 01:18:05 +0200 Subject: [PATCH] Prefer comparison operators as part of the class --- libs/ardour/ardour/port_engine_shared.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/ardour/ardour/port_engine_shared.h b/libs/ardour/ardour/port_engine_shared.h index 9dd0004d59..d6782e317f 100644 --- a/libs/ardour/ardour/port_engine_shared.h +++ b/libs/ardour/ardour/port_engine_shared.h @@ -104,6 +104,10 @@ class LIBARDOUR_API BackendPort : public ProtoPort void update_connected_latency (bool for_playback); + bool operator< (BackendPort const& rhs) const { + return PBD::naturally_less (name ().c_str (), rhs.name ().c_str ()); + } + protected: PortEngineSharedImpl& _backend; @@ -215,7 +219,7 @@ protected: struct SortByPortName { bool operator() (BackendPortHandle lhs, BackendPortHandle rhs) const { - return PBD::naturally_less (lhs->name ().c_str (), rhs->name ().c_str ()); + return *lhs < *rhs; } };