Bug 110107

Summary: [Soup] Superfluous HashMap check in SocketStreamHandleSoup::getHandleFromId()
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: cgarcia, danw, gustavo, laszlo.gombos, mrobinson, rakuco, webkit.review.bot, yutak
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Chris Dumez 2013-02-18 05:47:52 PST
SocketStreamHandleSoup::getHandleFromId() currently does the following:

static HashMap<void*, SocketStreamHandle*> gActiveHandles;
static SocketStreamHandle* getHandleFromId(void* id)
{
    if (!gActiveHandles.contains(id))
        return 0;
    return gActiveHandles.get(id);
}

The gActiveHandles.contains() checks is superfluous as gActiveHandles.get() will already return 0 if the key cannot be found.
Comment 1 Chris Dumez 2013-02-18 05:52:00 PST
Created attachment 188864 [details]
Patch
Comment 2 WebKit Review Bot 2013-02-18 09:21:12 PST
Comment on attachment 188864 [details]
Patch

Clearing flags on attachment: 188864

Committed r143233: <http://trac.webkit.org/changeset/143233>
Comment 3 WebKit Review Bot 2013-02-18 09:21:16 PST
All reviewed patches have been landed.  Closing bug.