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.lauhakangas@libreoffice.org>
This commit is contained in:
Simon Chenery
2025-06-23 15:13:47 +02:00
committed by Ilmari Lauhakangas
parent 540235deb4
commit 2e8d637e2d
+2 -5
View File
@@ -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;
}