Skip to content

Commit

Permalink
Bug 1716045 - Optimize ArcSlice equality operator for pointer equalit…
Browse files Browse the repository at this point in the history
…y. r=jfkthame

Just drive-by, but seems reasonable to avoid the per-element comparison
if the pointers are the same.

Depends on D118015

Differential Revision: https://phabricator.services.mozilla.com/D118016
  • Loading branch information
emilio committed Jun 18, 2021
1 parent 1140cee commit 9e9ecbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion layout/style/ServoStyleConstsInlines.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ inline Span<const T> StyleArcSlice<T>::AsSpan() const {
template <typename T>
inline bool StyleArcSlice<T>::operator==(const StyleArcSlice& aOther) const {
ASSERT_CANARY
return AsSpan() == aOther.AsSpan();
return _0.ptr == aOther._0.ptr || AsSpan() == aOther.AsSpan();
}

template <typename T>
Expand Down

0 comments on commit 9e9ecbd

Please sign in to comment.