From 83ad5bfba0840dfbf2803f76bdf06110c254f9ad Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Mon, 2 Jan 2023 00:21:05 -0700 Subject: [PATCH] AK: Remove global free function comparison operators for timespec No code was using these, so let's just delete them. They pollute the lookup for every single comparison operator in the project. --- AK/Time.h | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/AK/Time.h b/AK/Time.h index a9b40374588..526e55f7630 100644 --- a/AK/Time.h +++ b/AK/Time.h @@ -346,43 +346,6 @@ inline void timespec_to_timeval(TimespecType const& ts, TimevalType& tv) tv.tv_usec = ts.tv_nsec / 1000; } -template -inline bool operator>=(T const& a, T const& b) -{ - return a.tv_sec > b.tv_sec || (a.tv_sec == b.tv_sec && a.tv_nsec >= b.tv_nsec); -} - -template -inline bool operator>(T const& a, T const& b) -{ - return a.tv_sec > b.tv_sec || (a.tv_sec == b.tv_sec && a.tv_nsec > b.tv_nsec); -} - -template -inline bool operator<(T const& a, T const& b) -{ - return a.tv_sec < b.tv_sec || (a.tv_sec == b.tv_sec && a.tv_nsec < b.tv_nsec); -} - -template -inline bool operator<=(T const& a, T const& b) - -{ - return a.tv_sec < b.tv_sec || (a.tv_sec == b.tv_sec && a.tv_nsec <= b.tv_nsec); -} - -template -inline bool operator==(T const& a, T const& b) -{ - return a.tv_sec == b.tv_sec && a.tv_nsec == b.tv_nsec; -} - -template -inline bool operator!=(T const& a, T const& b) -{ - return a.tv_sec != b.tv_sec || a.tv_nsec != b.tv_nsec; -} - // To use these, add a ``using namespace AK::TimeLiterals`` at block or file scope namespace TimeLiterals { @@ -412,10 +375,4 @@ using AK::timeval_add; using AK::timeval_sub; using AK::timeval_to_timespec; using AK::years_to_days_since_epoch; -using AK::operator<=; -using AK::operator<; -using AK::operator>; -using AK::operator>=; -using AK::operator==; -using AK::operator!=; #endif