Prefer prefix ++/-- operators for non-primitive types

https://bugs.webkit.org/show_bug.cgi?id=114033

Reviewed by Alexey Proskuryakov.

Post ++/-- creates a copy of current value and it is not necessary, so use prefix instead.

* bindings/js/Dictionary.cpp:
(WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
(WebCore::Dictionary::getOwnPropertyNames):
* bindings/js/ScriptCallStackFactory.cpp:
(WebCore::createScriptCallStack):
* dom/ContainerNode.cpp:
(WebCore::willRemoveChildren):
* dom/Range.cpp:
(WebCore::Range::processAncestorsAndTheirSiblings):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::detachChildren):
* platform/graphics/gpu/LoopBlinnPathProcessor.cpp:
(WebCore):
(WebCore::LoopBlinnPathProcessor::subdivideCurvesSlow):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintDocumentMarkers):
* xml/XPathFunctions.cpp:
(WebCore::XPath::Function::setArguments):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147832 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2a8e9f3b
2013-04-05 Kangil Han <kangil.han@samsung.com>
Prefer prefix ++/-- operators for non-primitive types
https://bugs.webkit.org/show_bug.cgi?id=114033
Reviewed by Alexey Proskuryakov.
Post ++/-- creates a copy of current value and it is not necessary, so use prefix instead.
* bindings/js/Dictionary.cpp:
(WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
(WebCore::Dictionary::getOwnPropertyNames):
* bindings/js/ScriptCallStackFactory.cpp:
(WebCore::createScriptCallStack):
* dom/ContainerNode.cpp:
(WebCore::willRemoveChildren):
* dom/Range.cpp:
(WebCore::Range::processAncestorsAndTheirSiblings):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::detachChildren):
* platform/graphics/gpu/LoopBlinnPathProcessor.cpp:
(WebCore):
(WebCore::LoopBlinnPathProcessor::subdivideCurvesSlow):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintDocumentMarkers):
* xml/XPathFunctions.cpp:
(WebCore::XPath::Function::setArguments):
2013-04-05 Hans Muller <hmuller@adobe.com> 2013-04-05 Hans Muller <hmuller@adobe.com>
[CSS Exclusions] Add support for the simple case of shape-margin polygonal shape-outside [CSS Exclusions] Add support for the simple case of shape-margin polygonal shape-outside
...@@ -64,7 +64,7 @@ bool Dictionary::getOwnPropertiesAsStringHashMap(HashMap<String, String>& map) c ...@@ -64,7 +64,7 @@ bool Dictionary::getOwnPropertiesAsStringHashMap(HashMap<String, String>& map) c
PropertyNameArray propertyNames(exec); PropertyNameArray propertyNames(exec);
JSObject::getOwnPropertyNames(object, exec, propertyNames, ExcludeDontEnumProperties); JSObject::getOwnPropertyNames(object, exec, propertyNames, ExcludeDontEnumProperties);
for (PropertyNameArray::const_iterator it = propertyNames.begin(); it != propertyNames.end(); it++) { for (PropertyNameArray::const_iterator it = propertyNames.begin(); it != propertyNames.end(); ++it) {
String stringKey = it->string(); String stringKey = it->string();
if (stringKey.isEmpty()) if (stringKey.isEmpty())
continue; continue;
...@@ -89,7 +89,7 @@ bool Dictionary::getOwnPropertyNames(Vector<String>& names) const ...@@ -89,7 +89,7 @@ bool Dictionary::getOwnPropertyNames(Vector<String>& names) const
PropertyNameArray propertyNames(exec); PropertyNameArray propertyNames(exec);
JSObject::getOwnPropertyNames(object, exec, propertyNames, ExcludeDontEnumProperties); JSObject::getOwnPropertyNames(object, exec, propertyNames, ExcludeDontEnumProperties);
for (PropertyNameArray::const_iterator it = propertyNames.begin(); it != propertyNames.end(); it++) { for (PropertyNameArray::const_iterator it = propertyNames.begin(); it != propertyNames.end(); ++it) {
String stringKey = it->string(); String stringKey = it->string();
if (!stringKey.isEmpty()) if (!stringKey.isEmpty())
names.append(stringKey); names.append(stringKey);
......
...@@ -462,7 +462,7 @@ static void willRemoveChildren(ContainerNode* container) ...@@ -462,7 +462,7 @@ static void willRemoveChildren(ContainerNode* container)
container->document()->nodeChildrenWillBeRemoved(container); container->document()->nodeChildrenWillBeRemoved(container);
ChildListMutationScope mutation(container); ChildListMutationScope mutation(container);
for (NodeVector::const_iterator it = children.begin(); it != children.end(); it++) { for (NodeVector::const_iterator it = children.begin(); it != children.end(); ++it) {
Node* child = it->get(); Node* child = it->get();
mutation.willRemoveChild(child); mutation.willRemoveChild(child);
child->notifyMutationObserversNodeWillDetach(); child->notifyMutationObserversNodeWillDetach();
......
...@@ -873,7 +873,7 @@ PassRefPtr<Node> Range::processAncestorsAndTheirSiblings(ActionType action, Node ...@@ -873,7 +873,7 @@ PassRefPtr<Node> Range::processAncestorsAndTheirSiblings(ActionType action, Node
ancestors.append(n); ancestors.append(n);
RefPtr<Node> firstChildInAncestorToProcess = direction == ProcessContentsForward ? container->nextSibling() : container->previousSibling(); RefPtr<Node> firstChildInAncestorToProcess = direction == ProcessContentsForward ? container->nextSibling() : container->previousSibling();
for (Vector<RefPtr<Node> >::const_iterator it = ancestors.begin(); it != ancestors.end(); it++) { for (Vector<RefPtr<Node> >::const_iterator it = ancestors.begin(); it != ancestors.end(); ++it) {
RefPtr<Node> ancestor = *it; RefPtr<Node> ancestor = *it;
if (action == EXTRACT_CONTENTS || action == CLONE_CONTENTS) { if (action == EXTRACT_CONTENTS || action == CLONE_CONTENTS) {
if (RefPtr<Node> clonedAncestor = ancestor->cloneNode(false)) { // Might have been removed already during mutation event. if (RefPtr<Node> clonedAncestor = ancestor->cloneNode(false)) { // Might have been removed already during mutation event.
...@@ -892,7 +892,7 @@ PassRefPtr<Node> Range::processAncestorsAndTheirSiblings(ActionType action, Node ...@@ -892,7 +892,7 @@ PassRefPtr<Node> Range::processAncestorsAndTheirSiblings(ActionType action, Node
child = (direction == ProcessContentsForward) ? child->nextSibling() : child->previousSibling()) child = (direction == ProcessContentsForward) ? child->nextSibling() : child->previousSibling())
nodes.append(child); nodes.append(child);
for (NodeVector::const_iterator it = nodes.begin(); it != nodes.end(); it++) { for (NodeVector::const_iterator it = nodes.begin(); it != nodes.end(); ++it) {
Node* child = it->get(); Node* child = it->get();
switch (action) { switch (action) {
case DELETE_CONTENTS: case DELETE_CONTENTS:
......
...@@ -2305,7 +2305,7 @@ void FrameLoader::detachChildren() ...@@ -2305,7 +2305,7 @@ void FrameLoader::detachChildren()
for (Frame* child = m_frame->tree()->lastChild(); child; child = child->tree()->previousSibling()) for (Frame* child = m_frame->tree()->lastChild(); child; child = child->tree()->previousSibling())
childrenToDetach.append(child); childrenToDetach.append(child);
FrameVector::iterator end = childrenToDetach.end(); FrameVector::iterator end = childrenToDetach.end();
for (FrameVector::iterator it = childrenToDetach.begin(); it != end; it++) for (FrameVector::iterator it = childrenToDetach.begin(); it != end; ++it)
(*it)->loader()->detachFromParent(); (*it)->loader()->detachFromParent();
} }
......
...@@ -1098,9 +1098,7 @@ void LoopBlinnPathProcessor::subdivideCurvesSlow() ...@@ -1098,9 +1098,7 @@ void LoopBlinnPathProcessor::subdivideCurvesSlow()
for (Vector<Segment*>::iterator iter = curSegments.begin(); iter != curSegments.end(); ++iter) { for (Vector<Segment*>::iterator iter = curSegments.begin(); iter != curSegments.end(); ++iter) {
Segment* seg = *iter; Segment* seg = *iter;
ASSERT(seg->kind() == Segment::Cubic); ASSERT(seg->kind() == Segment::Cubic);
for (Vector<Segment*>::iterator iter2 = curSegments.begin(); for (Vector<Segment*>::iterator iter2 = curSegments.begin(); iter2 != curSegments.end(); ++iter2) {
iter2 != curSegments.end();
iter2++) {
Segment* seg2 = *iter2; Segment* seg2 = *iter2;
ASSERT(seg2->kind() == Segment::Cubic); ASSERT(seg2->kind() == Segment::Cubic);
if (seg != seg2) { if (seg != seg2) {
......
...@@ -1398,7 +1398,7 @@ void InlineTextBox::paintDocumentMarkers(GraphicsContext* pt, const FloatPoint& ...@@ -1398,7 +1398,7 @@ void InlineTextBox::paintDocumentMarkers(GraphicsContext* pt, const FloatPoint&
// Give any document markers that touch this run a chance to draw before the text has been drawn. // Give any document markers that touch this run a chance to draw before the text has been drawn.
// Note end() points at the last char, not one past it like endOffset and ranges do. // Note end() points at the last char, not one past it like endOffset and ranges do.
for ( ; markerIt != markers.end(); markerIt++) { for ( ; markerIt != markers.end(); ++markerIt) {
DocumentMarker* marker = *markerIt; DocumentMarker* marker = *markerIt;
// Paint either the background markers or the foreground markers, but not both // Paint either the background markers or the foreground markers, but not both
......
...@@ -299,7 +299,7 @@ void Function::setArguments(const Vector<Expression*>& args) ...@@ -299,7 +299,7 @@ void Function::setArguments(const Vector<Expression*>& args)
setIsContextNodeSensitive(false); setIsContextNodeSensitive(false);
Vector<Expression*>::const_iterator end = args.end(); Vector<Expression*>::const_iterator end = args.end();
for (Vector<Expression*>::const_iterator it = args.begin(); it != end; it++) for (Vector<Expression*>::const_iterator it = args.begin(); it != end; ++it)
addSubExpression(*it); addSubExpression(*it);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment