mirror of
https://github.com/servo/servo.git
synced 2025-07-25 16:20:36 +01:00
servo_arc: Make Arc do a pointer equality check in eq and ne first.
This commit is contained in:
parent
715fc9cea6
commit
9c738711bc
1 changed files with 2 additions and 2 deletions
|
@ -389,11 +389,11 @@ impl<T: ?Sized> Drop for Arc<T> {
|
||||||
|
|
||||||
impl<T: ?Sized + PartialEq> PartialEq for Arc<T> {
|
impl<T: ?Sized + PartialEq> PartialEq for Arc<T> {
|
||||||
fn eq(&self, other: &Arc<T>) -> bool {
|
fn eq(&self, other: &Arc<T>) -> bool {
|
||||||
*(*self) == *(*other)
|
Self::ptr_eq(self, other) || *(*self) == *(*other)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn ne(&self, other: &Arc<T>) -> bool {
|
fn ne(&self, other: &Arc<T>) -> bool {
|
||||||
*(*self) != *(*other)
|
!Self::ptr_eq(self, other) && *(*self) != *(*other)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl<T: ?Sized + PartialOrd> PartialOrd for Arc<T> {
|
impl<T: ?Sized + PartialOrd> PartialOrd for Arc<T> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue