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

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

Issue 544083002: Avoid allocating temporary ranges in connection with text and character iterators. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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
Index: Source/core/editing/PlainTextRange.cpp
diff --git a/Source/core/editing/PlainTextRange.cpp b/Source/core/editing/PlainTextRange.cpp
index 986799b8d47d5d01c8aacb92d14991c471168388..b0680dbacccca02b6195d3c6883c381dd2896672 100644
--- a/Source/core/editing/PlainTextRange.cpp
+++ b/Source/core/editing/PlainTextRange.cpp
@@ -87,7 +87,7 @@ PassRefPtrWillBeRawPtr<Range> PlainTextRange::createRangeFor(const ContainerNode
if (!start() && !length() && it.atEnd()) {
textRunRange = it.range();
- resultRange->setStart(textRunRange->startContainer(), 0, ASSERT_NO_EXCEPTION);
+ resultRange->setStart(it.startContainer(), 0, ASSERT_NO_EXCEPTION);
resultRange->setEnd(textRunRange->startContainer(), 0, ASSERT_NO_EXCEPTION);
yosin_UTC9 2014/09/08 01:55:19 nit: It seems we can replace L91 |textRunRange->st
Mads Ager (chromium) 2014/09/08 08:50:46 Yes, good catch, not sure why I didn't notice that
return resultRange.release();

Powered by Google App Engine
This is Rietveld 408576698