From a21bc53ea09ee3330ab336546649b88b5758e228 Mon Sep 17 00:00:00 2001 From: Christian Meissl Date: Fri, 17 May 2024 21:09:28 +0200 Subject: [PATCH] timers: inline hint for timeouts --- src/sources/timer.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sources/timer.rs b/src/sources/timer.rs index 09ebba09..b6331c9d 100644 --- a/src/sources/timer.rs +++ b/src/sources/timer.rs @@ -276,6 +276,7 @@ impl TimerWheel { // trait implementations for TimeoutData impl std::cmp::Ord for TimeoutData { + #[inline] fn cmp(&self, other: &Self) -> std::cmp::Ordering { // earlier values have priority self.deadline.cmp(&other.deadline).reverse() @@ -283,6 +284,7 @@ impl std::cmp::Ord for TimeoutData { } impl std::cmp::PartialOrd for TimeoutData { + #[inline] fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } @@ -292,6 +294,7 @@ impl std::cmp::PartialOrd for TimeoutData { // and the type is private, so ignore its coverage impl std::cmp::PartialEq for TimeoutData { #[cfg_attr(feature = "nightly_coverage", coverage(off))] + #[inline] fn eq(&self, other: &Self) -> bool { self.deadline == other.deadline }