From e8f2ccb42014b5eccabd42e5f95190be9e8f4519 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 24 May 2022 10:54:09 +0200 Subject: 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 --- include/xmloff/namespacemap.hxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include/xmloff/namespacemap.hxx') 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 > 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 { -- cgit