Bug 117031

Summary: Fix double hash lookup in DocumentEventQueue::cancelEvent().
Product: WebKit Reporter: Andreas Kling <kling>
Component: UI EventsAssignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, esprehn+autocc, kling
Priority: P2 Keywords: Performance
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch andersca: review+

Description Andreas Kling 2013-05-30 08:13:27 PDT
Fix double hash lookup in DocumentEventQueue::cancelEvent().
Comment 1 Andreas Kling 2013-05-30 08:15:00 PDT
Created attachment 203358 [details]
Patch
Comment 2 Anders Carlsson 2013-05-30 08:39:38 PDT
Comment on attachment 203358 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=203358&action=review

> Source/WebCore/dom/DocumentEventQueue.cpp:103
> +    m_queuedEvents.remove(it);

You only want to remove it if it's found.
Comment 3 Andreas Kling 2013-05-30 08:40:46 PDT
(In reply to comment #2)
> (From update of attachment 203358 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=203358&action=review
> 
> > Source/WebCore/dom/DocumentEventQueue.cpp:103
> > +    m_queuedEvents.remove(it);
> 
> You only want to remove it if it's found.

THE SHAME :(
Comment 4 Andreas Kling 2013-05-30 10:09:08 PDT
Committed r150969: <http://trac.webkit.org/changeset/150969>
Comment 5 Darin Adler 2013-05-30 10:16:09 PDT
I think we should add a bool return value to remove so we don’t have to use iterators in all the cases like this.