From 716661c0b66eddcbddda34b133f3c7fda97284bd Mon Sep 17 00:00:00 2001 From: Orson Peters Date: Tue, 10 Oct 2023 22:14:54 +0200 Subject: [PATCH] perf: slightly faster float equality --- crates/nano-arrow/src/util/total_ord.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/nano-arrow/src/util/total_ord.rs b/crates/nano-arrow/src/util/total_ord.rs index a3ab30e103ab..f6fe19bfbb5a 100644 --- a/crates/nano-arrow/src/util/total_ord.rs +++ b/crates/nano-arrow/src/util/total_ord.rs @@ -228,8 +228,8 @@ macro_rules! impl_eq_ord_float { impl TotalEq for $f { #[inline(always)] fn tot_eq(&self, other: &Self) -> bool { - if self.is_nan() && other.is_nan() { - true + if self.is_nan() { + other.is_nan() } else { self == other }