summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-17 15:22:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-17 17:36:56 +0200
commit05b2436ce1c9c4609810e61cfc3b282d33ed9456 (patch)
treefd70c1781cb2df5e0018461e1172199bec17508e
parente0559fb4c97208f39fedebdf7e4fcd084a165318 (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.cxx8
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;
}