Skip to content

Commit

Permalink
servo_arc: Make Arc do a pointer equality check in eq and ne first.
Browse files Browse the repository at this point in the history
  • Loading branch information
heycam committed Oct 11, 2017
1 parent 715fc9c commit 9c73871
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/servo_arc/lib.rs
Expand Up @@ -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> {
Expand Down

0 comments on commit 9c73871

Please sign in to comment.