From 9c738711bcc8d1a1da198b63acc1fca6eede9a0c Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Mon, 9 Oct 2017 16:57:49 +0800 Subject: [PATCH] servo_arc: Make Arc do a pointer equality check in eq and ne first. --- components/servo_arc/lib.rs | 4 ++-- 1 file 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 Drop for Arc { impl PartialEq for Arc { fn eq(&self, other: &Arc) -> bool { - *(*self) == *(*other) + Self::ptr_eq(self, other) || *(*self) == *(*other) } fn ne(&self, other: &Arc) -> bool { - *(*self) != *(*other) + !Self::ptr_eq(self, other) && *(*self) != *(*other) } } impl PartialOrd for Arc {