summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2021-11-23 12:15:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-11-23 13:47:16 +0100
commitda6ac377c6a4bb84ba4bdcc41e73c9079b009039 (patch)
tree4166841f0ced0400dfc0f89946722647f29c2e7c /tools
parent7566479a7a049d0e65d7506bc563e4d1c664b16d (diff)
avoid OUString temporary in INetURLObject::changeScheme
Change-Id: I8a97c1d89770fe2c0ba0d3f75ce9f3fec0df2e53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125692 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/fsys/urlobj.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 085c6d2846f0..6f4dfd068304 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -1476,8 +1476,6 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef,
}
void INetURLObject::changeScheme(INetProtocol eTargetScheme) {
- OUString aTmpStr=m_aAbsURIRef.toString();
- m_aAbsURIRef.setLength(0);
int oldSchemeLen = 0;
const OUString& rOldSchemeName = getSchemeInfo().m_sScheme;
if (m_eScheme == INetProtocol::Generic)
@@ -1487,8 +1485,8 @@ void INetURLObject::changeScheme(INetProtocol eTargetScheme) {
m_eScheme=eTargetScheme;
const OUString& rNewSchemeName = getSchemeInfo().m_sScheme;
int newSchemeLen = rNewSchemeName.getLength();
- m_aAbsURIRef.append(rNewSchemeName);
- m_aAbsURIRef.append(aTmpStr.getStr()+oldSchemeLen);
+ m_aAbsURIRef.remove(0, oldSchemeLen);
+ m_aAbsURIRef.insert(0, rNewSchemeName);
int delta=newSchemeLen-oldSchemeLen;
m_aUser+=delta;
m_aAuth+=delta;