summaryrefslogtreecommitdiff
path: root/dhall
diff options
context:
space:
mode:
authorNadrieril2020-01-30 22:10:40 +0000
committerNadrieril2020-01-30 22:10:40 +0000
commit4312ad935d881f269fa7e9cc3d880fa763db957d (patch)
treef7a03469eb22f8be07bb844ce391bbb6e6405172 /dhall
parent70af1a47bce9e6c8282d6e53cf82aeda9aab10de (diff)
Use Rc equality to shortcut Value equality
Diffstat (limited to 'dhall')
-rw-r--r--dhall/src/semantics/nze/value.rs3
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 {}