From 451314241dc40c4e3be600ef95a4f4fbd322f701 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 24 Aug 2023 11:48:45 +0200 Subject: Core/Misc: Modernize comparison operators (cherry picked from commit f0a862e71bc12d86a898901ef773475a7c964832) --- src/common/Utilities/TaskScheduler.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/common/Utilities/TaskScheduler.h') diff --git a/src/common/Utilities/TaskScheduler.h b/src/common/Utilities/TaskScheduler.h index 4d6761780be..3af5fc70a12 100644 --- a/src/common/Utilities/TaskScheduler.h +++ b/src/common/Utilities/TaskScheduler.h @@ -95,18 +95,13 @@ class TC_COMMON_API TaskScheduler Task& operator= (Task&& right) = delete; // Order tasks by its end - inline bool operator< (Task const& other) const + std::weak_ordering operator<=> (Task const& other) const { - return _end < other._end; - } - - inline bool operator> (Task const& other) const - { - return _end > other._end; + return _end <=> other._end; } // Compare tasks with its end - inline bool operator== (Task const& other) + bool operator== (Task const& other) const { return _end == other._end; } @@ -126,7 +121,7 @@ class TC_COMMON_API TaskScheduler bool operator() (TaskContainer const& left, TaskContainer const& right) const { return (*left.get()) < (*right.get()); - }; + } }; class TC_COMMON_API TaskQueue -- cgit v1.2.3