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

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

Issue 1190283002: Make textDistance() in SelectionController not to create a redundant Range object (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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: Source/core/editing/SelectionController.cpp
diff --git a/Source/core/editing/SelectionController.cpp b/Source/core/editing/SelectionController.cpp
index 2c31da36b6a9d78cd7c935ac67269609d39bb44a..f7d2cdf40ba118fa8b4d0a080f431992bdaa6519 100644
--- a/Source/core/editing/SelectionController.cpp
+++ b/Source/core/editing/SelectionController.cpp
@@ -240,8 +240,7 @@ bool SelectionController::handleMousePressEventTripleClick(const MouseEventWithH
static int textDistance(const Position& start, const Position& end)
{
- RefPtrWillBeRawPtr<Range> range = Range::create(*start.document(), start, end);
- return TextIterator::rangeLength(range->startPosition(), range->endPosition(), true);
+ return TextIterator::rangeLength(start, end, true);
}
bool SelectionController::handleMousePressEventSingleClick(const MouseEventWithHitTestResults& event)
« 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