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

Unified Diff: Source/core/page/EventHandler.cpp

Issue 152883002: (Concept patch) Simplify WTF::HashTable::add() return value for size and performance (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
Index: Source/core/page/EventHandler.cpp
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index c6c5a70987acb60a90b99bea6bda6d7faa59b87d..36e5193ce6de88740620cf52d0c51660233b3e06 100755
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -3715,8 +3715,10 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
// Ensure this target's touch list exists, even if it ends up empty, so it can always be passed to TouchEvent::Create below.
TargetTouchesMap::iterator targetTouchesIterator = touchesByTarget.find(touchTarget.get());
- if (targetTouchesIterator == touchesByTarget.end())
- targetTouchesIterator = touchesByTarget.set(touchTarget.get(), TouchList::create()).iterator;
+ if (targetTouchesIterator == touchesByTarget.end()) {
+ touchesByTarget.set(touchTarget.get(), TouchList::create());
+ targetTouchesIterator = touchesByTarget.find(touchTarget.get());
+ }
// touches and targetTouches should only contain information about touches still on the screen, so if this point is
// released or cancelled it will only appear in the changedTouches list.

Powered by Google App Engine
This is Rietveld 408576698