From 717605065a8c429435fe4a10f89659deb905c012 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 26 Sep 2024 14:04:20 +0200 Subject: [PATCH] Mark comparators const. --- server/TracyEvent.hpp | 6 +++--- server/TracyWorker.hpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/TracyEvent.hpp b/server/TracyEvent.hpp index 8557a785..b241a91a 100644 --- a/server/TracyEvent.hpp +++ b/server/TracyEvent.hpp @@ -179,7 +179,7 @@ private: uint8_t m_val[6]; }; -struct Int48Sort { bool operator()( const Int48& lhs, const Int48& rhs ) { return lhs.Val() < rhs.Val(); }; }; +struct Int48Sort { bool operator()( const Int48& lhs, const Int48& rhs ) const { return lhs.Val() < rhs.Val(); }; }; struct SourceLocationBase @@ -264,7 +264,7 @@ struct SampleData enum { SampleDataSize = sizeof( SampleData ) }; -struct SampleDataSort { bool operator()( const SampleData& lhs, const SampleData& rhs ) { return lhs.time.Val() < rhs.time.Val(); }; }; +struct SampleDataSort { bool operator()( const SampleData& lhs, const SampleData& rhs ) const { return lhs.time.Val() < rhs.time.Val(); }; }; struct SampleDataRange @@ -742,7 +742,7 @@ enum class PlotValueFormatting : uint8_t struct PlotData { - struct PlotItemSort { bool operator()( const PlotItem& lhs, const PlotItem& rhs ) { return lhs.time.Val() < rhs.time.Val(); }; }; + struct PlotItemSort { bool operator()( const PlotItem& lhs, const PlotItem& rhs ) const { return lhs.time.Val() < rhs.time.Val(); }; }; uint64_t name; double min; diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index 75700d81..2da4010a 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -198,7 +198,7 @@ public: private: struct SourceLocationZones { - struct ZtdSort { bool operator()( const ZoneThreadData& lhs, const ZoneThreadData& rhs ) { return lhs.Zone()->Start() < rhs.Zone()->Start(); } }; + struct ZtdSort { bool operator()( const ZoneThreadData& lhs, const ZoneThreadData& rhs ) const { return lhs.Zone()->Start() < rhs.Zone()->Start(); } }; SortedVector zones; int64_t min = std::numeric_limits::max(); @@ -217,7 +217,7 @@ private: struct GpuSourceLocationZones { - struct GpuZtdSort { bool operator()( const GpuZoneThreadData& lhs, const GpuZoneThreadData& rhs ) { return lhs.Zone()->GpuStart() < rhs.Zone()->GpuStart(); } }; + struct GpuZtdSort { bool operator()( const GpuZoneThreadData& lhs, const GpuZoneThreadData& rhs ) const { return lhs.Zone()->GpuStart() < rhs.Zone()->GpuStart(); } }; SortedVector zones; int64_t min = std::numeric_limits::max();