Skip to content
  • andersca@apple.com's avatar
    Remove Vector::prepend · 14e89e0a
    andersca@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=115618
    
    Reviewed by Geoffrey Garen.
    
    Source/WebCore:
    
    Replace calls to Vector::prepend with either Vector::insert,
    or a combination of Vector::append and Vector::reverse.
    
    * accessibility/AccessibilityObject.cpp:
    (WebCore::AccessibilityObject::scrollToGlobalPoint):
    * css/CSSGradientValue.cpp:
    (WebCore::CSSGradientValue::addStops):
    * css/CSSValueList.h:
    (WebCore::CSSValueList::prepend):
    * dom/Document.cpp:
    (WebCore::Document::iconURLs):
    * editing/TextIterator.cpp:
    (WebCore::SearchBuffer::prependContext):
    * editing/VisibleUnits.cpp:
    (WebCore::previousBoundary):
    (WebCore::nextBoundary):
    * history/HistoryItem.cpp:
    (WebCore::HistoryItem::padDailyCountsForNewVisit):
    (WebCore::HistoryItem::collapseDailyVisitsToWeekly):
    * inspector/InjectedScriptHost.cpp:
    (WebCore::InjectedScriptHost::addInspectedObject):
    * platform/graphics/SVGGlyph.cpp:
    (WebCore::charactersWithArabicForm):
    
    Source/WTF:
    
    Given the performance characteristics of prepending something to a Vector, not having prepend
    will hopefully make developers think about whether prepending is necessary at all. For example,
    the functions in HexNumber.h were easily converted to using Vector::append and then Vector::reverse.
    
    * wtf/HexNumber.h:
    (WTF::appendUnsignedAsHex):
    (WTF::appendUnsignedAsHexFixedSize):
    * wtf/Vector.h:
    (Vector):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149583 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    14e89e0a