diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-11-08 19:09:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-11-09 17:11:24 +0100 |
commit | 5ddbfea5f9f2c7fca852e2a25c804ad7050d14fa (patch) | |
tree | 79b2e3b1282a058d7777337b3135763f4844e598 /xmloff | |
parent | ebccc375248faebdfbca273b149483593c753387 (diff) |
micro-optimisation
Change-Id: I392b897be4f78bf368149ac47646c3d79790fd96
Reviewed-on: https://gerrit.libreoffice.org/82342
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/nmspmap.cxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/xmloff/source/core/nmspmap.cxx b/xmloff/source/core/nmspmap.cxx index 7aa50542b5e8..c1ee7412f438 100644 --- a/xmloff/source/core/nmspmap.cxx +++ b/xmloff/source/core/nmspmap.cxx @@ -173,19 +173,15 @@ const OUString& SvXMLNamespaceMap::GetNameByKey( sal_uInt16 nKey ) const OUString SvXMLNamespaceMap::GetAttrNameByKey( sal_uInt16 nKey ) const { - OUStringBuffer sAttrName; NameSpaceMap::const_iterator aIter = aNameMap.find ( nKey ); - if (aIter != aNameMap.end()) - { - sAttrName.append( sXMLNS ); - const OUString & prefix( (*aIter).second->sPrefix ); - if (!prefix.isEmpty()) // not default namespace - { - sAttrName.append( ':' ); - sAttrName.append( prefix ); - } - } - return sAttrName.makeStringAndClear(); + if (aIter == aNameMap.end()) + return OUString(); + + const OUString & prefix( (*aIter).second->sPrefix ); + if (prefix.isEmpty()) // default namespace + return sXMLNS; + + return sXMLNS + ":" + prefix; } OUString SvXMLNamespaceMap::GetQNameByKey( sal_uInt16 nKey, |