Bug 117031 - Fix double hash lookup in DocumentEventQueue::cancelEvent().
Summary: Fix double hash lookup in DocumentEventQueue::cancelEvent().
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords: Performance
Depends on:
Blocks:
 
Reported: 2013-05-30 08:13 PDT by Andreas Kling
Modified: 2013-05-30 10:16 PDT (History)
4 users (show)

See Also:


Attachments
Patch (1.32 KB, patch)
2013-05-30 08:15 PDT, Andreas Kling
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.