Ignore:
Timestamp:
Aug 22, 2020, 9:13:08 AM (5 years ago)
Author:
Darin Adler
Message:

Make some small improvements involving sorting
https://bugs.webkit.org/show_bug.cgi?id=215617

Reviewed by Anders Carlsson.

  • contentextensions/DFA.cpp:

(WebCore::ContentExtensions::printTransitions): Fixed "incomming" spelling error.

  • css/CSSImageSetValue.cpp:

(WebCore::CSSImageSetValue::fillImageSet): Use std::stable_sort instead of std::sort
because there is no guarantee that each image has different resolution and we want
repeatable behavior when they are the same.

  • page/Performance.cpp:

(WebCore::Performance::appendBufferedEntriesByType const): Removed the return
value since we don't need it any more.

  • page/Performance.h: Updated for above.
  • page/PerformanceObserver.cpp:

(WebCore::PerformanceObserver::observe): Use std::stable_sort only on the new
entries and then use std::inplace_merge. It's wasteful to re-sort the entire
array when adding entries. A little less elegant, but more efficient.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/css/CSSImageSetValue.cpp

    r257474 r266027  
    6464
    6565    // Sort the images so that they are stored in order from lowest resolution to highest.
    66     std::sort(m_imagesInSet.begin(), m_imagesInSet.end(), CSSImageSetValue::compareByScaleFactor);
     66    std::stable_sort(m_imagesInSet.begin(), m_imagesInSet.end(), CSSImageSetValue::compareByScaleFactor);
    6767}
    6868
Note: See TracChangeset for help on using the changeset viewer.