diff options
author | Nadrieril | 2020-01-30 22:10:40 +0000 |
---|---|---|
committer | Nadrieril | 2020-01-30 22:10:40 +0000 |
commit | 4312ad935d881f269fa7e9cc3d880fa763db957d (patch) | |
tree | f7a03469eb22f8be07bb844ce391bbb6e6405172 /dhall | |
parent | 70af1a47bce9e6c8282d6e53cf82aeda9aab10de (diff) |
Use Rc equality to shortcut Value equality
Diffstat (limited to 'dhall')
-rw-r--r-- | dhall/src/semantics/nze/value.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/dhall/src/semantics/nze/value.rs b/dhall/src/semantics/nze/value.rs index 67ab90a..de40d53 100644 --- a/dhall/src/semantics/nze/value.rs +++ b/dhall/src/semantics/nze/value.rs @@ -623,10 +623,9 @@ impl TextLit { } /// Compare two values for equality modulo alpha/beta-equivalence. -// TODO: use Rc comparison to shortcut on identical pointers impl std::cmp::PartialEq for Value { fn eq(&self, other: &Self) -> bool { - *self.kind() == *other.kind() + Rc::ptr_eq(&self.0, &other.0) || self.kind() == other.kind() } } impl std::cmp::Eq for Value {} |