mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 21:30:03 -04:00
Add emath::OrderedFloat (moved from epaint::util::OrderedFloat) (#4389)
It makes much more sense in `emath`
This commit is contained in:
@@ -152,32 +152,6 @@ macro_rules! epaint_assert {
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#[inline(always)]
|
||||
pub(crate) fn f32_hash<H: std::hash::Hasher>(state: &mut H, f: f32) {
|
||||
if f == 0.0 {
|
||||
state.write_u8(0);
|
||||
} else if f.is_nan() {
|
||||
state.write_u8(1);
|
||||
} else {
|
||||
use std::hash::Hash;
|
||||
f.to_bits().hash(state);
|
||||
}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub(crate) fn f64_hash<H: std::hash::Hasher>(state: &mut H, f: f64) {
|
||||
if f == 0.0 {
|
||||
state.write_u8(0);
|
||||
} else if f.is_nan() {
|
||||
state.write_u8(1);
|
||||
} else {
|
||||
use std::hash::Hash;
|
||||
f.to_bits().hash(state);
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// Was epaint compiled with the `rayon` feature?
|
||||
|
||||
Reference in New Issue
Block a user