editeng/source/editeng/impedit2.cxx |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 2e8d637e2d9f7a95e045cc2d18e34a29fcc2d87c
Author:     Simon Chenery <simon_chen...@yahoo.com>
AuthorDate: Sun Jun 15 20:45:56 2025 +0200
Commit:     Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
CommitDate: Mon Jun 23 15:13:47 2025 +0200

    tdf#153109 replace loop with std::any_of in impedit2.cxx
    
    Change-Id: I34fdbc9497f2e44ed3dbbd781eb26a9bb0f79051
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186525
    Tested-by: Jenkins
    Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index 2d8c3a0be64c..4110b37334dc 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -1923,11 +1923,8 @@ bool ImpEditEngine::HasScriptType( sal_Int32 nPara, 
sal_uInt16 nType ) const
         if (rTypes.empty())
             const_cast<ImpEditEngine*>(this)->InitScriptTypes( nPara );
 
-        for ( size_t n = rTypes.size(); n && !bTypeFound; )
-        {
-            if ( rTypes[--n].nScriptType == nType )
-                bTypeFound = true;
-        }
+        bTypeFound = std::any_of(rTypes.begin(), rTypes.end(),
+            [nType](const ScriptTypePosInfo& rType){ return rType.nScriptType 
== nType; });
     }
     return bTypeFound;
 }

Reply via email to