Don't add something to a hash map and then get it out again immediately if we don't need to.
Change-Id: Ic6718a7c23e8896f5bbbb5cadcc22aa9a3108530
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp
index ad29dc1..39fe724 100644
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@ -2600,10 +2600,13 @@
// The touch event should act on the originating touch target, not the current target
// TODO: Upstream this fix to webkit.org (see webkit bug 34585)
int touchPointId = point.id();
- if (point.state() == PlatformTouchPoint::TouchPressed)
+ EventTarget* touchTarget = 0;
+ if (point.state() == PlatformTouchPoint::TouchPressed) {
m_originatingTouchPointTargets.set(touchPointId, target);
+ touchTarget = target;
+ } else
+ touchTarget = m_originatingTouchPointTargets.get(touchPointId).get();
- EventTarget* touchTarget = m_originatingTouchPointTargets.get(touchPointId).get();
ASSERT(touchTarget);
RefPtr<Touch> touch = Touch::create(doc->frame(), touchTarget, touchPointId,