Bug 110107 - [Soup] Superfluous HashMap check in SocketStreamHandleSoup::getHandleFromId()
Summary: [Soup] Superfluous HashMap check in SocketStreamHandleSoup::getHandleFromId()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-18 05:47 PST by Chris Dumez
Modified: 2013-02-18 09:21 PST (History)
8 users (show)

See Also:


Attachments
Patch (1.68 KB, patch)
2013-02-18 05:52 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

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