Bug 122368 - Use more references instead of pointers in DocumentOrderedMap
Summary: Use more references instead of pointers in DocumentOrderedMap
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-04 19:05 PDT by Ryosuke Niwa
Modified: 2013-10-04 19:58 PDT (History)
5 users (show)

See Also:


Attachments
Cleanup (51.46 KB, patch)
2013-10-04 19:07 PDT, Ryosuke Niwa
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2013-10-04 19:05:59 PDT
Use more references instead of pointers in DocumentOrderedMap
Comment 1 Ryosuke Niwa 2013-10-04 19:07:00 PDT
Created attachment 213431 [details]
Cleanup
Comment 2 Andreas Kling 2013-10-04 19:21:43 PDT
Comment on attachment 213431 [details]
Cleanup

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

Super neato! r=me

> Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp:76
> +    Node* node = document->documentNamedItem(*atomicPropertyName);

This should be an Element*. That'll remove a branch from hasTagName() below.

> Source/WebCore/dom/DocumentOrderedMap.cpp:109
> +    Map::iterator it = m_map.find(&key);

I'd use auto for this.

> Source/WebCore/dom/DocumentOrderedMap.cpp:130
> +    Map::iterator it = m_map.find(&key);

Ditto.

> Source/WebCore/dom/DocumentOrderedMap.cpp:194
> +    Map::iterator it = m_map.find(&key);

Ditto.

> Source/WebCore/dom/DocumentOrderedMap.h:96
> +    Map::const_iterator it = m_map.find(&id);

Ditto.

> Source/WebCore/dom/DocumentOrderedMap.h:107
> +    Map::const_iterator it = m_map.find(&id);

Ditto.
Comment 3 Ryosuke Niwa 2013-10-04 19:22:24 PDT
Comment on attachment 213431 [details]
Cleanup

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

> Source/WebCore/dom/IdTargetObserverRegistry.h:67
>      ASSERT(!m_notifyingObserversInSet);

Oops, I need to assert that id is not empty here.

> Source/WebCore/dom/TreeScope.cpp:244
> +        return m_imageMapsByName->getElementByLowercasedMapName(*AtomicString(name.lower()).impl(), *this);
> +    return m_imageMapsByName->getElementByMapName(*AtomicString(name).impl(), *this);

We should store AtomicString in a local variable here.
Comment 4 Ryosuke Niwa 2013-10-04 19:58:22 PDT
Committed r156940: <http://trac.webkit.org/changeset/156940>