From 369d48001926bf3e86b0c0d7ac5ae21a00c8b450 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Mon, 23 Jul 2012 08:20:11 -0700 Subject: [PATCH] Bug 772690: Speed up nsDisplayList::SortByZOrder by removing (unnecessary) secondary sort by content order. r=dbaron --- layout/base/nsDisplayList.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 2f07b5e3b79..6072a424b42 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -859,9 +859,7 @@ static bool IsZOrderLEQ(nsDisplayItem* aItem1, nsDisplayItem* aItem2, // z-indices here, because that might overflow a 32-bit int. PRInt32 index1 = nsLayoutUtils::GetZIndex(aItem1->GetUnderlyingFrame()); PRInt32 index2 = nsLayoutUtils::GetZIndex(aItem2->GetUnderlyingFrame()); - if (index1 == index2) - return IsContentLEQ(aItem1, aItem2, aClosure); - return index1 < index2; + return index1 <= index2; } void nsDisplayList::ExplodeAnonymousChildLists(nsDisplayListBuilder* aBuilder) {