cppu/source/typelib/typelib.cxx |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit f381c353b4b24f185c6517593e78671b33d64baa
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Mon Nov 8 21:08:09 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Nov 9 09:17:34 2021 +0100

    BaseList doesn't need set member after the constructor is done
    
    Change-Id: Idc174a0cd53c45beba3100b1f8258e6839291be8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124885
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx
index 650ac27c3ad9..8ae7ca64865e 100644
--- a/cppu/source/typelib/typelib.cxx
+++ b/cppu/source/typelib/typelib.cxx
@@ -867,11 +867,11 @@ private:
     typedef std::set< OUString > Set;
 
     void calculate(
+        Set& allSet,
         sal_Int32 directBaseIndex, Set & directBaseSet,
         sal_Int32 * directBaseMembers,
         typelib_InterfaceTypeDescription const * desc);
 
-    Set set;
     List list;
     sal_Int32 members;
 };
@@ -879,24 +879,26 @@ private:
 BaseList::BaseList(typelib_InterfaceTypeDescription const * desc)
    : members(0)
 {
+    Set allSet;
     for (sal_Int32 i = 0; i < desc->nBaseTypes; ++i) {
         Set directBaseSet;
         sal_Int32 directBaseMembers = 0;
-        calculate(i, directBaseSet, &directBaseMembers, desc->ppBaseTypes[i]);
+        calculate(allSet, i, directBaseSet, &directBaseMembers, 
desc->ppBaseTypes[i]);
     }
 }
 
 void BaseList::calculate(
+    Set& allSet,
     sal_Int32 directBaseIndex, Set & directBaseSet,
     sal_Int32 * directBaseMembers,
     typelib_InterfaceTypeDescription const * desc)
 {
     for (sal_Int32 i = 0; i < desc->nBaseTypes; ++i) {
-        calculate(
+        calculate(allSet,
             directBaseIndex, directBaseSet, directBaseMembers,
             desc->ppBaseTypes[i]);
     }
-    if (set.insert(desc->aBase.pTypeName).second) {
+    if (allSet.insert(desc->aBase.pTypeName).second) {
         Entry e;
         e.memberOffset = members;
         e.directBaseIndex = directBaseIndex;

Reply via email to