configmgr/source/access.cxx      |    2 +-
 configmgr/source/access.hxx      |    2 +-
 configmgr/source/childaccess.cxx |    2 +-
 configmgr/source/childaccess.hxx |    2 +-
 configmgr/source/rootaccess.cxx  |    2 +-
 configmgr/source/rootaccess.hxx  |    2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 52a0f9e6b881c21275358de3ec9b4c85f77402e4
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed May 11 10:59:29 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed May 11 15:08:33 2022 +0200

    avoid some ref-counting traffic in configmgr::Access:getNameInternal
    
    Change-Id: I3062855ab8f9ec9f1e7cdffe163f1c78865d5b9d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134154
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 30e75eb9e8b7..806ff8944d81 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -1416,7 +1416,7 @@ rtl::Reference< ChildAccess > Access::getChild(OUString 
const & name) {
                 getAllChildren());
             for (auto const& child : children)
             {
-                OUString name2(child->getNameInternal());
+                const OUString & name2(child->getNameInternal());
                 if (name2.startsWith(locale) &&
                     (name2.getLength() == locale.getLength() ||
                      name2[locale.getLength()] == '-' ||
diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx
index 6d4ca787f3cc..811c63693835 100644
--- a/configmgr/source/access.hxx
+++ b/configmgr/source/access.hxx
@@ -301,7 +301,7 @@ protected:
 
     virtual ~Access() override;
 
-    virtual OUString getNameInternal() = 0;
+    virtual const OUString & getNameInternal() = 0;
     virtual rtl::Reference< RootAccess > getRootAccess() = 0;
     virtual rtl::Reference< Access > getParentAccess() = 0;
 
diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
index 87def984be17..6010a5a5ce3b 100644
--- a/configmgr/source/childaccess.cxx
+++ b/configmgr/source/childaccess.cxx
@@ -121,7 +121,7 @@ bool ChildAccess::isFinalized() {
         (parent_.is() && parent_->isFinalized());
 }
 
-OUString ChildAccess::getNameInternal() {
+const OUString & ChildAccess::getNameInternal() {
     return name_;
 }
 
diff --git a/configmgr/source/childaccess.hxx b/configmgr/source/childaccess.hxx
index d063a28c9c9c..dc7e47005d2f 100644
--- a/configmgr/source/childaccess.hxx
+++ b/configmgr/source/childaccess.hxx
@@ -71,7 +71,7 @@ public:
 
     virtual bool isFinalized() override;
 
-    virtual OUString getNameInternal() override;
+    virtual const OUString & getNameInternal() override;
 
     virtual rtl::Reference< RootAccess > getRootAccess() override;
     virtual rtl::Reference< Access > getParentAccess() override;
diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx
index 17c8f7ec12a2..1043bd9bedab 100644
--- a/configmgr/source/rootaccess.cxx
+++ b/configmgr/source/rootaccess.cxx
@@ -233,7 +233,7 @@ bool RootAccess::isFinalized() {
     return finalized_;
 }
 
-OUString RootAccess::getNameInternal() {
+const OUString & RootAccess::getNameInternal() {
     getNode();
     return name_;
 }
diff --git a/configmgr/source/rootaccess.hxx b/configmgr/source/rootaccess.hxx
index 11fbea450eed..982de3c6f2c8 100644
--- a/configmgr/source/rootaccess.hxx
+++ b/configmgr/source/rootaccess.hxx
@@ -98,7 +98,7 @@ private:
 
     virtual bool isFinalized() override;
 
-    virtual OUString getNameInternal() override;
+    virtual const OUString & getNameInternal() override;
 
     virtual rtl::Reference< RootAccess > getRootAccess() override;
 

Reply via email to