comphelper/source/property/ChainablePropertySetInfo.cxx |    2 +-
 comphelper/source/property/MasterPropertySetInfo.cxx    |    2 +-
 comphelper/source/property/propertysetinfo.cxx          |    4 ++--
 include/comphelper/sequenceashashmap.hxx                |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 7bd9aaccb99287e4e50fb18759edc7688502a1fb
Author:     Sakura286 <sakura...@outlook.com>
AuthorDate: Fri Oct 18 13:52:44 2024 +0800
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Oct 18 10:02:51 2024 +0200

    tdf#158237 comphelper: Use C++20 contains() instead of find() and end()
    
    Change-Id: I3fc233ffc4c57b02e605306cb9bf3903a88401a4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175116
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/comphelper/source/property/ChainablePropertySetInfo.cxx 
b/comphelper/source/property/ChainablePropertySetInfo.cxx
index 4515e5c4314b..a68c0c32c5d5 100644
--- a/comphelper/source/property/ChainablePropertySetInfo.cxx
+++ b/comphelper/source/property/ChainablePropertySetInfo.cxx
@@ -89,7 +89,7 @@ Property SAL_CALL 
ChainablePropertySetInfo::getPropertyByName( const OUString& r
 
 sal_Bool SAL_CALL ChainablePropertySetInfo::hasPropertyByName( const OUString& 
rName )
 {
-    return maMap.find ( rName ) != maMap.end();
+    return maMap.contains( rName );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/source/property/MasterPropertySetInfo.cxx 
b/comphelper/source/property/MasterPropertySetInfo.cxx
index 4040b479a05c..c7ec69b56ecf 100644
--- a/comphelper/source/property/MasterPropertySetInfo.cxx
+++ b/comphelper/source/property/MasterPropertySetInfo.cxx
@@ -99,7 +99,7 @@ Property SAL_CALL MasterPropertySetInfo::getPropertyByName( 
const OUString& rNam
 
 sal_Bool SAL_CALL MasterPropertySetInfo::hasPropertyByName( const OUString& 
rName )
 {
-    return maMap.find ( rName ) != maMap.end();
+    return maMap.contains( rName );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/source/property/propertysetinfo.cxx 
b/comphelper/source/property/propertysetinfo.cxx
index 1d4ad2be8d25..2f959d25dfe4 100644
--- a/comphelper/source/property/propertysetinfo.cxx
+++ b/comphelper/source/property/propertysetinfo.cxx
@@ -37,7 +37,7 @@ PropertySetInfo::PropertySetInfo( std::span<const 
PropertyMapEntry> pMap ) noexc
     for (const auto & rEntry : pMap)
     {
         // check for duplicates
-        assert(maPropertyMap.find(rEntry.maName) == maPropertyMap.end());
+        assert(!maPropertyMap.contains(rEntry.maName));
         // Make sure there are no accidental empty entries left at the end of 
the array from
         // when this method used to take a empty-terminated array.
         assert(!rEntry.maName.isEmpty());
@@ -56,7 +56,7 @@ void PropertySetInfo::add( std::span<PropertyMapEntry const> 
pMap ) noexcept
     for (const auto & rEntry : pMap)
     {
         // check for duplicates
-        assert(maPropertyMap.find(rEntry.maName) == maPropertyMap.end());
+        assert(!maPropertyMap.contains(rEntry.maName));
         // Make sure there are no accidental empty entries left at the end of 
the array from
         // when this method used to take a empty-terminated array.
         assert(!rEntry.maName.isEmpty());
diff --git a/include/comphelper/sequenceashashmap.hxx 
b/include/comphelper/sequenceashashmap.hxx
index e0de5ead44f8..f7d669468156 100644
--- a/include/comphelper/sequenceashashmap.hxx
+++ b/include/comphelper/sequenceashashmap.hxx
@@ -297,7 +297,7 @@ class SAL_WARN_UNUSED COMPHELPER_DLLPUBLIC SequenceAsHashMap
         bool createItemIfMissing(const OUString& sKey  ,
                                      const TValueType&      aValue)
         {
-            if (m_aMap.find(sKey) == m_aMap.end())
+            if (!m_aMap.contains(sKey))
             {
                 (*this)[sKey] = css::uno::toAny(aValue);
                 return true;

Reply via email to