diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-09-30 20:22:30 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-10-01 06:33:11 +0200 |
commit | 1fc63383ccd8af144d681ba405f5ead863ac24e1 (patch) | |
tree | 77d41033131babef8db1dd7ffb6e00b0f0ac3237 /svx | |
parent | 4814e8caa5f06c4fe438dfd7d7315e4a2410ea18 (diff) |
Avoid redundant IsAtEnd: NextItem returns nullptr iif iterator is at end
To keep the check efficient, split NextItem to inline and Impl parts
Change-Id: Id5877a3c5bed73aac9c39c655b106a715cf888ea
Reviewed-on: https://gerrit.libreoffice.org/79894
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/srchdlg.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index bc751ab885d3..fc36f99258f5 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -196,7 +196,7 @@ void SearchAttrItemList::Put( const SfxItemSet& rSet ) const SfxPoolItem* pItem = aIter.GetCurItem(); sal_uInt16 nWhich; - while ( true ) + do { // only test that it is available? if( IsInvalidItem( pItem ) ) @@ -213,10 +213,8 @@ void SearchAttrItemList::Put( const SfxItemSet& rSet ) aItem.nSlot = pPool->GetSlotId( nWhich ); Insert( aItem ); - if ( aIter.IsAtEnd() ) - break; pItem = aIter.NextItem(); - } + } while (pItem); } |