Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(712)

Unified Diff: Source/core/dom/NodeTraversal.cpp

Issue 69543007: Have NodeTraversal::nextSkippingChildren() take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/NodeTraversal.h ('k') | Source/core/dom/Range.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/NodeTraversal.cpp
diff --git a/Source/core/dom/NodeTraversal.cpp b/Source/core/dom/NodeTraversal.cpp
index e07b695893546b0c567a5a79edb4bb4af5fc34df..1ec16961d852b29263ce18f6fb46e3d64359fc48 100644
--- a/Source/core/dom/NodeTraversal.cpp
+++ b/Source/core/dom/NodeTraversal.cpp
@@ -74,25 +74,25 @@ Node* nextIncludingPseudoSkippingChildren(const Node* current, const Node* stayW
return 0;
}
-Node* nextAncestorSibling(const Node* current)
+Node* nextAncestorSibling(const Node& current)
{
- ASSERT(!current->nextSibling());
- for (current = current->parentNode(); current; current = current->parentNode()) {
- if (current->nextSibling())
- return current->nextSibling();
+ ASSERT(!current.nextSibling());
+ for (Node* parent = current.parentNode(); parent; parent = parent->parentNode()) {
+ if (parent->nextSibling())
+ return parent->nextSibling();
}
return 0;
}
-Node* nextAncestorSibling(const Node* current, const Node* stayWithin)
+Node* nextAncestorSibling(const Node& current, const Node* stayWithin)
{
- ASSERT(!current->nextSibling());
+ ASSERT(!current.nextSibling());
ASSERT(current != stayWithin);
- for (current = current->parentNode(); current; current = current->parentNode()) {
- if (current == stayWithin)
+ for (Node* parent = current.parentNode(); parent; parent = parent->parentNode()) {
+ if (parent == stayWithin)
return 0;
- if (current->nextSibling())
- return current->nextSibling();
+ if (parent->nextSibling())
+ return parent->nextSibling();
}
return 0;
}
« no previous file with comments | « Source/core/dom/NodeTraversal.h ('k') | Source/core/dom/Range.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698