diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-17 15:22:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-17 17:36:56 +0200 |
commit | 05b2436ce1c9c4609810e61cfc3b282d33ed9456 (patch) | |
tree | fd70c1781cb2df5e0018461e1172199bec17508e | |
parent | e0559fb4c97208f39fedebdf7e4fcd084a165318 (diff) |
simplify CacheItem::update
both branches of the if can be easily accomplished with the same code
Change-Id: Iadef72b1e125a11fc27f628a26900ae30dc98220
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134479
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | filter/source/config/cache/cacheitem.cxx | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/filter/source/config/cache/cacheitem.cxx b/filter/source/config/cache/cacheitem.cxx index 2c50df8578d3..dc28b5471d55 100644 --- a/filter/source/config/cache/cacheitem.cxx +++ b/filter/source/config/cache/cacheitem.cxx @@ -40,13 +40,7 @@ CacheItem::CacheItem() void CacheItem::update(const CacheItem& rUpdateItem) { for (auto const& elem : rUpdateItem) - { - iterator pItThis = find(elem.first); - if (pItThis == end()) - (*this)[elem.first] = elem.second; // add new prop - else - pItThis->second = elem.second; // change value of existing prop - } + (*this)[elem.first] = elem.second; } |