summaryrefslogtreecommitdiff
path: root/xmlreader
diff options
context:
space:
mode:
Diffstat (limited to 'xmlreader')
-rw-r--r--xmlreader/source/span.cxx4
-rw-r--r--xmlreader/source/xmlreader.cxx6
2 files changed, 6 insertions, 4 deletions
diff --git a/xmlreader/source/span.cxx b/xmlreader/source/span.cxx
index 29433c561fb7..300c0a2e99b3 100644
--- a/xmlreader/source/span.cxx
+++ b/xmlreader/source/span.cxx
@@ -46,6 +46,10 @@ OUString Span::convertFromUtf8() const {
return OUString(s, SAL_NO_ACQUIRE);
}
+std::size_t Span::hashCode() const {
+ return rtl_str_hashCode_WithLength(begin, length);
+}
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlreader/source/xmlreader.cxx b/xmlreader/source/xmlreader.cxx
index 0194f6c695a7..95a27a785b5c 100644
--- a/xmlreader/source/xmlreader.cxx
+++ b/xmlreader/source/xmlreader.cxx
@@ -182,9 +182,7 @@ Span XmlReader::getAttributeValue(bool fullyNormalize) {
}
int XmlReader::getNamespaceId(Span const & prefix) const {
- OUString spanString = prefix.convertFromUtf8();
-
- if (auto it = cacheNSIds_.find(spanString); it != cacheNSIds_.end())
+ if (auto it = cacheNSIds_.find(prefix); it != cacheNSIds_.end())
{
return it->second;
}
@@ -194,7 +192,7 @@ int XmlReader::getNamespaceId(Span const & prefix) const {
if (i != namespaces_.rend())
{
- cacheNSIds_[spanString]= i->nsId;
+ cacheNSIds_[i->prefix]= i->nsId;
return i->nsId;
}