Try not to check slice bounds in straight hasher.

This commit is contained in:
Stephen Chung
2021-03-05 09:31:56 +08:00
parent 01664ef7ee
commit 0fa3968b74
2 changed files with 7 additions and 6 deletions

View File

@@ -1109,7 +1109,7 @@ pub struct FloatWrapper(FLOAT);
#[cfg(not(feature = "no_float"))]
impl Hash for FloatWrapper {
fn hash<H: crate::stdlib::hash::Hasher>(&self, state: &mut H) {
self.0.to_le_bytes().hash(state);
self.0.to_ne_bytes().hash(state);
}
}