svl/source/items/itemset.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit 92cd851c924486829aa7592ee41a62d2d97b755d Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon Oct 31 08:04:19 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Oct 31 09:22:36 2022 +0100 tdf#126788 only call TotalCount() if we need the result Change-Id: Idcacc67f005204ac499f8cdff2792e97636ae85c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142056 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index 4894e85a6a06..655956f2d1cc 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -157,9 +157,9 @@ SfxItemSet::~SfxItemSet() { if (!m_pWhichRanges.empty()) // might be nullptr if we have been moved-from { - sal_uInt16 nCount = TotalCount(); if( Count() ) { + sal_uInt16 nCount = TotalCount(); SfxPoolItem const** ppFnd = m_ppItems; for( sal_uInt16 nCnt = nCount; nCnt; --nCnt, ++ppFnd ) if( *ppFnd && !IsInvalidItem(*ppFnd) )