summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Iacovitti <aiacovitti@libero.it>2012-06-25 06:02:58 (GMT)
committerAndrea Iacovitti <aiacovitti@libero.it>2012-06-25 06:02:58 (GMT)
commit223196e00c9f35a6c5a41a4ada595ed73c3fbf62 (patch)
tree90b0ca470a1ec8d875a3ed0c0909e72c097c1846
parent48b3b2d63026e9f9a145304d73194af3327d38ff (diff)
Use directly DOMString as key for nameCache QHash.
-rw-r--r--khtml/html/html_miscimpl.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/khtml/html/html_miscimpl.cpp b/khtml/html/html_miscimpl.cpp
index 7d02577..135626d 100644
--- a/khtml/html/html_miscimpl.cpp
+++ b/khtml/html/html_miscimpl.cpp
@@ -53,7 +53,7 @@ struct CollectionCache: public DynamicNodeListImpl::Cache
{
static Cache* make() { return new CollectionCache; }
- QHash<QString,QList<NodeImpl*>* > nameCache;
+ QHash<DOMString,QList<NodeImpl*>* > nameCache;
CollectionCache(): Cache(DocumentImpl::TV_IDNameHref) {}
@@ -291,13 +291,12 @@ QList<NodeImpl*> HTMLCollectionImpl::namedItems( const DOMString &name ) const
{
if (name.isEmpty())
return QList<NodeImpl*>();
- QString key = name.string();
//We use a work-conserving design for the name cache presently -- only
//remember stuff about elements we were asked for.
m_cache->updateNodeListInfo(m_refNode->document());
CollectionCache* cache = static_cast<CollectionCache*>(m_cache);
- if (QList<NodeImpl*>* info = cache->nameCache.value(key)) {
+ if (QList<NodeImpl*>* info = cache->nameCache.value(name)) {
return *info;
}
else {
@@ -309,7 +308,7 @@ QList<NodeImpl*> HTMLCollectionImpl::namedItems( const DOMString &name ) const
match = nextNamedItem(name);
}
- cache->nameCache.insertMulti(key, newInfo);
+ cache->nameCache.insertMulti(name, newInfo);
return *newInfo;
}
}