Commit 148b1714 authored by dsmith@webkit.org's avatar dsmith@webkit.org

2009-01-05 David Smith <catfish.man@gmail.com>

        Reviewed by Oliver Hunt.

        https://bugs.webkit.org/show_bug.cgi?id=23084
        Avoid redundant AtomicString conversions

        * dom/Node.cpp: Create an AtomicString early to avoid converting twice
        (WebCore::Node::getElementsByTagNameNS):
        * dom/QualifiedName.h: Use the appropriate AtomicString constructor instead of converting from a String



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c75c1a00
2009-01-05 David Smith <catfish.man@gmail.com>
Reviewed by Oliver Hunt.
https://bugs.webkit.org/show_bug.cgi?id=23084
Avoid redundant AtomicString conversions
* dom/Node.cpp: Create an AtomicString early to avoid converting twice
(WebCore::Node::getElementsByTagNameNS):
* dom/QualifiedName.h: Use the appropriate AtomicString constructor instead of converting from a String
2009-01-05 Simon Fraser <simon.fraser@apple.com>
Reviewed by Dave Hyatt
......@@ -473,6 +484,7 @@
Reviewed by Oliver Hunt.
https://bugs.webkit.org/show_bug.cgi?id=23084
Avoid redundant AtomicString conversions
* dom/Node.cpp:
......@@ -1391,12 +1391,14 @@ PassRefPtr<NodeList> Node::getElementsByTagNameNS(const AtomicString& namespaceU
String name = localName;
if (document()->isHTMLDocument())
name = localName.lower();
AtomicString localNameAtom = name;
pair<NodeListsNodeData::TagCacheMap::iterator, bool> result = data->nodeLists()->m_tagNodeListCaches.add(QualifiedName(nullAtom, name, namespaceURI), 0);
pair<NodeListsNodeData::TagCacheMap::iterator, bool> result = data->nodeLists()->m_tagNodeListCaches.add(QualifiedName(nullAtom, localNameAtom, namespaceURI), 0);
if (result.second)
result.first->second = new DynamicNodeList::Caches;
return TagNodeList::create(this, namespaceURI.isEmpty() ? nullAtom : namespaceURI, name, result.first->second);
return TagNodeList::create(this, namespaceURI.isEmpty() ? nullAtom : namespaceURI, localNameAtom, result.first->second);
}
PassRefPtr<NodeList> Node::getElementsByName(const String& elementName)
......
......@@ -161,7 +161,7 @@ namespace WTF {
template<> struct HashTraits<WebCore::QualifiedName> : GenericHashTraits<WebCore::QualifiedName> {
static const bool emptyValueIsZero = false;
static WebCore::QualifiedName emptyValue() { return WebCore::QualifiedName(WebCore::nullAtom, WebCore::nullAtom, WebCore::nullAtom); }
static void constructDeletedValue(WebCore::QualifiedName& slot) { new (&slot) WebCore::QualifiedName(WebCore::nullAtom, WebCore::String(HashTableDeletedValue), WebCore::nullAtom); }
static void constructDeletedValue(WebCore::QualifiedName& slot) { new (&slot) WebCore::QualifiedName(WebCore::nullAtom, WebCore::AtomicString(HashTableDeletedValue), WebCore::nullAtom); }
static bool isDeletedValue(const WebCore::QualifiedName& slot) { return slot.localName().isHashTableDeletedValue(); }
};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment