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

Unified Diff: third_party/WebKit/Source/core/editing/VisibleUnitsLine.cpp

Issue 2940053003: Refactor NextLeafWithSameEditability() (Closed)
Patch Set: 2017-06-15T16:53:53 Created 3 years, 6 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/VisibleUnitsLine.cpp
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnitsLine.cpp b/third_party/WebKit/Source/core/editing/VisibleUnitsLine.cpp
index 624a66267d6c0b6620ffdfc98e00facc41445f91..8c940442c29d26afca3f2996d415d09a743b7d37 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnitsLine.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleUnitsLine.cpp
@@ -102,12 +102,11 @@ Node* NextLeafWithSameEditability(
if (!node)
return nullptr;
- bool editable = HasEditableStyle(*node, editable_type);
- node = NextAtomicLeafNode(*node);
- while (node) {
- if (editable == HasEditableStyle(*node, editable_type))
- return node;
- node = NextAtomicLeafNode(*node);
+ const bool editable = HasEditableStyle(*node, editable_type);
+ for (Node* runner = NextAtomicLeafNode(*node); runner;
+ runner = NextAtomicLeafNode(*runner)) {
+ if (editable == HasEditableStyle(*runner, editable_type))
+ return runner;
}
return nullptr;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698