Skip to content

Commit b6404e5

Browse files
committed
use to_bits()
1 parent 0b5a9c9 commit b6404e5

File tree

1 file changed

+6
-6
lines changed
  • datafusion/physical-expr/src/expressions

1 file changed

+6
-6
lines changed

datafusion/physical-expr/src/expressions/in_list.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ impl ArrayStaticFilter {
213213
}
214214
}
215215

216-
/// Wrapper for f32 that implements Hash and Eq using IEEE 754 total ordering.
217-
/// This treats NaN values as equal to each other (using total_cmp).
216+
/// Wrapper for f32 that implements Hash and Eq using bit comparison.
217+
/// This treats NaN values as equal to each other when they have the same bit pattern.
218218
#[derive(Clone, Copy)]
219219
struct OrderedFloat32(f32);
220220

@@ -226,7 +226,7 @@ impl Hash for OrderedFloat32 {
226226

227227
impl PartialEq for OrderedFloat32 {
228228
fn eq(&self, other: &Self) -> bool {
229-
self.0.total_cmp(&other.0).is_eq()
229+
self.0.to_bits() == other.0.to_bits()
230230
}
231231
}
232232

@@ -238,8 +238,8 @@ impl From<f32> for OrderedFloat32 {
238238
}
239239
}
240240

241-
/// Wrapper for f64 that implements Hash and Eq using IEEE 754 total ordering.
242-
/// This treats NaN values as equal to each other (using total_cmp).
241+
/// Wrapper for f64 that implements Hash and Eq using bit comparison.
242+
/// This treats NaN values as equal to each other when they have the same bit pattern.
243243
#[derive(Clone, Copy)]
244244
struct OrderedFloat64(f64);
245245

@@ -251,7 +251,7 @@ impl Hash for OrderedFloat64 {
251251

252252
impl PartialEq for OrderedFloat64 {
253253
fn eq(&self, other: &Self) -> bool {
254-
self.0.total_cmp(&other.0).is_eq()
254+
self.0.to_bits() == other.0.to_bits()
255255
}
256256
}
257257

0 commit comments

Comments
 (0)