summaryrefslogtreecommitdiff
path: root/dhall/src/semantics
diff options
context:
space:
mode:
Diffstat (limited to '')
-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 {}