[Libreoffice-commits] core.git: cppu/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 31 07:17:29 UTC 2021


 cppu/source/uno/lbenv.cxx |   23 +++++++----------------
 1 file changed, 7 insertions(+), 16 deletions(-)

New commits:
commit a36d1308f946d890fcdf7887169f284704e4a5bf
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Aug 31 08:22:30 2021 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Aug 31 09:16:54 2021 +0200

    Elide class makeOIdPart
    
    ...which is no longer needed since 00f257a7ef4f1ec52887bc379c14757e057e94c8
    "rtl::Static -> thread-safe static local"
    
    Change-Id: Ie78154c5d8b6ad8278405d1ce56c76997e0478d5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121347
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx
index ad61cee0cf67..f018cde00cfd 100644
--- a/cppu/source/uno/lbenv.cxx
+++ b/cppu/source/uno/lbenv.cxx
@@ -786,13 +786,10 @@ extern "C" void SAL_CALL uno_dumpEnvironmentByName(
 
 namespace
 {
-    class makeOIdPart
-    {
-    private:
-        OUString m_sOidPart;
-    public:
-        makeOIdPart()
-        {
+
+const OUString & unoenv_getStaticOIdPart()
+{
+    static auto const theStaticOIdPart = [] {
             OUStringBuffer aRet( 64 );
             aRet.append( "];" );
             // pid
@@ -814,15 +811,9 @@ namespace
             for (unsigned char i : ar)
                 aRet.append( static_cast<sal_Int32>(i), 16 );
 
-            m_sOidPart = aRet.makeStringAndClear();
-        }
-        const OUString& getOIdPart() const { return m_sOidPart; }
-    };
-
-const OUString & unoenv_getStaticOIdPart()
-{
-    static makeOIdPart theStaticOIdPart;
-    return theStaticOIdPart.getOIdPart();
+            return aRet.makeStringAndClear();
+        }();
+    return theStaticOIdPart;
 }
 
 }


More information about the Libreoffice-commits mailing list