Ignore:
Timestamp:
May 5, 2013, 9:10:14 PM (12 years ago)
Author:
[email protected]
Message:

Remove Vector::prepend
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):

File:
1 edited

Legend:

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

    r148921 r149583  
    293293                    GradientStop newStop = stops[originalFirstStopIndex + srcStopOrdinal];
    294294                    newStop.offset = currOffset;
    295                     stops.prepend(newStop);
     295                    stops.insert(0, newStop);
    296296                    ++originalFirstStopIndex;
    297297                    if (currOffset < 0)
Note: See TracChangeset for help on using the changeset viewer.