diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-24 10:54:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-24 13:03:03 +0200 |
commit | e8f2ccb42014b5eccabd42e5f95190be9e8f4519 (patch) | |
tree | 056009f864fdc6db2958008d1dbfde82847da1fb /include/xmloff/namespacemap.hxx | |
parent | 7f2bcfe5f69e31a4166830422db5cd95c5bfaa80 (diff) |
flatten the maps in SvXMLNamespaceMap
to reduce pointer chasing
Change-Id: I8d581c03f80fa279a93ed23b7116c6f950405b7a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134857
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/xmloff/namespacemap.hxx')
-rw-r--r-- | include/xmloff/namespacemap.hxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/xmloff/namespacemap.hxx b/include/xmloff/namespacemap.hxx index 361ddfb7311d..81edfc52e25d 100644 --- a/include/xmloff/namespacemap.hxx +++ b/include/xmloff/namespacemap.hxx @@ -38,7 +38,7 @@ const sal_uInt16 XML_NAMESPACE_NONE = USHRT_MAX-1; const sal_uInt16 XML_NAMESPACE_UNKNOWN = USHRT_MAX; const sal_uInt16 XML_NAMESPACE_UNKNOWN_FLAG = 0x8000; -class NameSpaceEntry final : public salhelper::SimpleReferenceObject +class NameSpaceEntry final { public: // sName refers to the full namespace name @@ -47,6 +47,11 @@ public: OUString sPrefix; // nKey is the unique identifier of a namespace sal_uInt16 nKey; + + bool operator==(NameSpaceEntry const & rhs) const + { + return sName == rhs.sName && sPrefix == rhs.sPrefix && nKey == rhs.nKey; + } }; typedef ::std::pair < sal_uInt16, OUString > QNamePair; @@ -63,8 +68,8 @@ struct QNamePairHash }; typedef std::unordered_map < QNamePair, OUString, QNamePairHash > QNameCache; -typedef std::unordered_map < OUString, ::rtl::Reference <NameSpaceEntry > > NameSpaceHash; -typedef std::unordered_map < sal_uInt16, ::rtl::Reference < NameSpaceEntry > > NameSpaceMap; +typedef std::unordered_map < OUString, NameSpaceEntry > NameSpaceHash; +typedef std::unordered_map < sal_uInt16, NameSpaceEntry > NameSpaceMap; class XMLOFF_DLLPUBLIC SvXMLNamespaceMap { |