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.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2021-11-08 21:08:09 +02:00 committed by Noel Grandin
parent d55b263134
commit f381c353b4

View file

@ -867,11 +867,11 @@ private:
typedef std::set< OUString > Set; typedef std::set< OUString > Set;
void calculate( void calculate(
Set& allSet,
sal_Int32 directBaseIndex, Set & directBaseSet, sal_Int32 directBaseIndex, Set & directBaseSet,
sal_Int32 * directBaseMembers, sal_Int32 * directBaseMembers,
typelib_InterfaceTypeDescription const * desc); typelib_InterfaceTypeDescription const * desc);
Set set;
List list; List list;
sal_Int32 members; sal_Int32 members;
}; };
@ -879,24 +879,26 @@ private:
BaseList::BaseList(typelib_InterfaceTypeDescription const * desc) BaseList::BaseList(typelib_InterfaceTypeDescription const * desc)
: members(0) : members(0)
{ {
Set allSet;
for (sal_Int32 i = 0; i < desc->nBaseTypes; ++i) { for (sal_Int32 i = 0; i < desc->nBaseTypes; ++i) {
Set directBaseSet; Set directBaseSet;
sal_Int32 directBaseMembers = 0; sal_Int32 directBaseMembers = 0;
calculate(i, directBaseSet, &directBaseMembers, desc->ppBaseTypes[i]); calculate(allSet, i, directBaseSet, &directBaseMembers, desc->ppBaseTypes[i]);
} }
} }
void BaseList::calculate( void BaseList::calculate(
Set& allSet,
sal_Int32 directBaseIndex, Set & directBaseSet, sal_Int32 directBaseIndex, Set & directBaseSet,
sal_Int32 * directBaseMembers, sal_Int32 * directBaseMembers,
typelib_InterfaceTypeDescription const * desc) typelib_InterfaceTypeDescription const * desc)
{ {
for (sal_Int32 i = 0; i < desc->nBaseTypes; ++i) { for (sal_Int32 i = 0; i < desc->nBaseTypes; ++i) {
calculate( calculate(allSet,
directBaseIndex, directBaseSet, directBaseMembers, directBaseIndex, directBaseSet, directBaseMembers,
desc->ppBaseTypes[i]); desc->ppBaseTypes[i]);
} }
if (set.insert(desc->aBase.pTypeName).second) { if (allSet.insert(desc->aBase.pTypeName).second) {
Entry e; Entry e;
e.memberOffset = members; e.memberOffset = members;
e.directBaseIndex = directBaseIndex; e.directBaseIndex = directBaseIndex;