mirror of
https://github.com/servo/servo.git
synced 2025-06-25 17:44:33 +01:00
Auto merge of #18793 - heycam:ptr-eq, r=emilio
servo_arc: Try pointer equality test first when comparing two Arcs. This doesn't actually help https://bugzilla.mozilla.org/show_bug.cgi?id=1405411 but seems like something we should do. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18793) <!-- Reviewable:end -->
This commit is contained in:
commit
b1c7a2fa6d
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> {
|
||||
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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue