diff options
author | Cameron McCormack <cam@mcc.id.au> | 2017-10-09 16:57:49 +0800 |
---|---|---|
committer | Cameron McCormack <cam@mcc.id.au> | 2017-10-11 09:24:03 +0800 |
commit | 9c738711bcc8d1a1da198b63acc1fca6eede9a0c (patch) | |
tree | 83b16d95c368c15c191b623997a90af3b350a345 /components/servo_arc/lib.rs | |
parent | 715fc9cea6ed4ad22772c6d20136eac66cfe275c (diff) | |
download | servo-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.rs | 4 |
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> { |