Skip to content

Commit

Permalink
sql: use enum discriminant in Value::hash()
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgrinaker committed Jul 13, 2024
1 parent 812b360 commit 196d802
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sql/types/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl std::cmp::Eq for Value {}

impl std::hash::Hash for Value {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.datatype().hash(state);
core::mem::discriminant(self).hash(state);
// Normalize to treat +/-0.0 and +/-NAN as equal when hashing.
match self.normalize_ref().as_ref() {
Self::Null => {}
Expand Down

0 comments on commit 196d802

Please sign in to comment.