chart2/source/model/main/DataSeries.cxx       |    4 ++--
 codemaker/source/codemaker/options.cxx        |    5 +----
 comphelper/source/container/namecontainer.cxx |    2 +-
 3 files changed, 4 insertions(+), 7 deletions(-)

New commits:
commit 8cf9bdbadefaddd9fef9a13e19f519911ca99cc3
Author:     Manish <mailmessgcn...@proton.me>
AuthorDate: Fri Aug 1 23:31:03 2025 +0530
Commit:     Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
CommitDate: Fri Aug 8 21:07:16 2025 +0200

    tdf#158237 Use C++20 contains() instead of find() and end()
    
    Change-Id: I9a17900837330031a906cb3526b624936ec87bd7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188790
    Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
    Tested-by: Jenkins

diff --git a/chart2/source/model/main/DataSeries.cxx 
b/chart2/source/model/main/DataSeries.cxx
index a9843f1d423d..0b7461043810 100644
--- a/chart2/source/model/main/DataSeries.cxx
+++ b/chart2/source/model/main/DataSeries.cxx
@@ -753,7 +753,7 @@ bool DataSeries::hasPointOwnColor(
 bool DataSeries::hasPointOwnProperties( sal_Int32 nPointIndex )
 {
     MutexGuard aGuard( m_aMutex );
-    return m_aAttributedDataPoints.find(nPointIndex) != 
m_aAttributedDataPoints.end();
+    return m_aAttributedDataPoints.contains(nPointIndex);
 }
 
 sal_Int32 DataSeries::getAttachedAxisIndex()
@@ -925,7 +925,7 @@ bool DataSeries::hasDataLabelAtPoint( sal_Int32 nPointIndex 
)
         bool bFound = false;
         {
             MutexGuard aGuard( m_aMutex );
-            bFound = m_aAttributedDataPoints.find(nPointIndex) != 
m_aAttributedDataPoints.end();
+            bFound = m_aAttributedDataPoints.contains(nPointIndex);
         }
         if (bFound)
             xProp = getDataPointByIndex(nPointIndex);
diff --git a/codemaker/source/codemaker/options.cxx 
b/codemaker/source/codemaker/options.cxx
index 906ae69ecba1..48b5aa044999 100644
--- a/codemaker/source/codemaker/options.cxx
+++ b/codemaker/source/codemaker/options.cxx
@@ -23,10 +23,7 @@ Options::Options() {}
 
 Options::~Options() {}
 
-bool Options::isValid(const OString& option) const
-{
-    return m_options.find(option) != m_options.end();
-}
+bool Options::isValid(const OString& option) const { return 
m_options.contains(option); }
 
 const OString& Options::getOption(const OString& option) const
 {
diff --git a/comphelper/source/container/namecontainer.cxx 
b/comphelper/source/container/namecontainer.cxx
index 7e70526ec053..98f0b0b312ce 100644
--- a/comphelper/source/container/namecontainer.cxx
+++ b/comphelper/source/container/namecontainer.cxx
@@ -81,7 +81,7 @@ void SAL_CALL NameContainer::insertByName( const OUString& 
aName, const Any& aEl
 {
     std::scoped_lock aGuard( maMutex );
 
-    if( maProperties.find( aName ) != maProperties.end() )
+    if( maProperties.contains( aName ) )
         throw ElementExistException();
 
     if( aElement.getValueType() != maType )

Reply via email to