Remove Vector::prepend
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 May 2013 04:10:14 +0000 (04:10 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 May 2013 04:10:14 +0000 (04:10 +0000)
commitfc2f4a52d363e5f6bdfb854a8f514469193050a2
tree66109c41a9ec7900d4718df8ad1d42422d6c5ae9
parent72892f090d3acf1732bfc035b7744041690f1c10
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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@149583 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/HexNumber.h
Source/WTF/wtf/Vector.h
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/css/CSSGradientValue.cpp
Source/WebCore/css/CSSValueList.h
Source/WebCore/dom/Document.cpp
Source/WebCore/editing/TextIterator.cpp
Source/WebCore/editing/VisibleUnits.cpp
Source/WebCore/history/HistoryItem.cpp
Source/WebCore/inspector/InjectedScriptHost.cpp
Source/WebCore/platform/graphics/SVGGlyph.cpp