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

Unified Diff: Source/core/editing/ApplyStyleCommand.cpp

Issue 124973002: Cleanup - Get rid of unnecessary local variables. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Cleanup patch Created 6 years, 11 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: Source/core/editing/ApplyStyleCommand.cpp
diff --git a/Source/core/editing/ApplyStyleCommand.cpp b/Source/core/editing/ApplyStyleCommand.cpp
index eeb18cb903bc437e0a70737c3d25d95f9ff6b7da..c6d44a3181cb5da027ddca6cf0a5a1f4aa470703 100644
--- a/Source/core/editing/ApplyStyleCommand.cpp
+++ b/Source/core/editing/ApplyStyleCommand.cpp
@@ -496,9 +496,7 @@ void ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock(Node* node, Node* unsp
if (!block)
return;
- Node* parent = 0;
- for (Node* n = node->parentNode(); n != block && n != unsplitAncestor; n = parent) {
- parent = n->parentNode();
+ for (Node* n = node->parentNode(); n != block && n != unsplitAncestor; n = n->parentNode()) {
if (!n->isStyledElement())
continue;
@@ -1333,12 +1331,11 @@ void ApplyStyleCommand::surroundNodeRangeWithElement(PassRefPtr<Node> passedStar
ASSERT(passedStartNode);
ASSERT(endNode);
ASSERT(elementToInsert);
- RefPtr<Node> startNode = passedStartNode;
+ RefPtr<Node> node = passedStartNode;
RefPtr<Element> element = elementToInsert;
- insertNodeBefore(element, startNode);
+ insertNodeBefore(element, node);
- RefPtr<Node> node = startNode;
while (node) {
RefPtr<Node> next = node->nextSibling();
if (node->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable)) {
« 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