diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-02-16 18:39:23 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-18 07:41:05 +0100 |
commit | 44841a6778821be3e68ab15819b39064b20e968f (patch) | |
tree | 8e9119cf35764f18f5b008e7758c6f950306fb8c /filter/source/msfilter/escherex.cxx | |
parent | bcfbd24be02d2de5d4d27c147dc58c4515a9a0f5 (diff) |
Simplify containers iterations in [f-l]*
Use range-based loop or replace with STL functions
Change-Id: Ib3fab47318d1bfbb4df8f886a8cd9596525a420f
Reviewed-on: https://gerrit.libreoffice.org/67914
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter/source/msfilter/escherex.cxx')
-rw-r--r-- | filter/source/msfilter/escherex.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 50e10a4af1fb..32756294d391 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -3794,13 +3794,10 @@ void EscherPersistTable::PtInsert( sal_uInt32 nID, sal_uInt32 nOfs ) void EscherPersistTable::PtDelete( sal_uInt32 nID ) { - for(auto it = maPersistTable.begin(); it != maPersistTable.end() ; ++it) - { - if ( (*it)->mnID == nID ) { - maPersistTable.erase( it ); - break; - } - } + auto it = std::find_if(maPersistTable.begin(), maPersistTable.end(), + [&nID](const std::unique_ptr<EscherPersistEntry>& rxEntry) { return rxEntry->mnID == nID; }); + if (it != maPersistTable.end()) + maPersistTable.erase( it ); } sal_uInt32 EscherPersistTable::PtGetOffsetByID( sal_uInt32 nID ) |