filter/source/config/cache/cacheitem.cxx |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

New commits:
commit 05b2436ce1c9c4609810e61cfc3b282d33ed9456
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue May 17 15:22:33 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue May 17 17:36:56 2022 +0200

    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.gran...@collabora.co.uk>

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;
 }
 
 

Reply via email to