aboutsummaryrefslogtreecommitdiffstats
path: root/components/servo_arc/lib.rs
diff options
context:
space:
mode:
authorCameron McCormack <cam@mcc.id.au>2017-10-09 16:57:49 +0800
committerCameron McCormack <cam@mcc.id.au>2017-10-11 09:24:03 +0800
commit9c738711bcc8d1a1da198b63acc1fca6eede9a0c (patch)
tree83b16d95c368c15c191b623997a90af3b350a345 /components/servo_arc/lib.rs
parent715fc9cea6ed4ad22772c6d20136eac66cfe275c (diff)
downloadservo-9c738711bcc8d1a1da198b63acc1fca6eede9a0c.tar.gz
servo-9c738711bcc8d1a1da198b63acc1fca6eede9a0c.zip
servo_arc: Make Arc do a pointer equality check in eq and ne first.
Diffstat (limited to 'components/servo_arc/lib.rs')
-rw-r--r--components/servo_arc/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/servo_arc/lib.rs b/components/servo_arc/lib.rs
index 49a04dea1fc..7d17c26cd51 100644
--- a/components/servo_arc/lib.rs
+++ b/components/servo_arc/lib.rs
@@ -389,11 +389,11 @@ impl<T: ?Sized> Drop for Arc<T> {
impl<T: ?Sized + PartialEq> PartialEq for Arc<T> {
fn eq(&self, other: &Arc<T>) -> bool {
- *(*self) == *(*other)
+ Self::ptr_eq(self, other) || *(*self) == *(*other)
}
fn ne(&self, other: &Arc<T>) -> bool {
- *(*self) != *(*other)
+ !Self::ptr_eq(self, other) && *(*self) != *(*other)
}
}
impl<T: ?Sized + PartialOrd> PartialOrd for Arc<T> {