linguistic/source/spelldsp.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
New commits: commit 9df6108dd7bd301a1b8d60c08b2f2d508c8bd125 Author: Simon Chenery <simon_chen...@yahoo.com> AuthorDate: Tue Jan 28 17:55:04 2025 +0100 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Feb 3 11:30:13 2025 +0100 tdf#153109 simplify any_of to find without lambda Simplify a std::any_of call to std::find, which avoids the need for a lambda function. Change-Id: Ibc4799b77e4997440d58995d37e39c6eae411764 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180851 Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> Tested-by: Jenkins diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx index a8c20748bbab..0abdaa0489fe 100644 --- a/linguistic/source/spelldsp.cxx +++ b/linguistic/source/spelldsp.cxx @@ -83,9 +83,7 @@ void ProposalList::Append( const OUString &rOrig, bool bPrepend ) { // convert ASCII apostrophe to the typographic one const OUString aText( rOrig.indexOf( '\'' ) > -1 ? rOrig.replace('\'', u'’') : rOrig ); - const bool bFound = std::any_of(aVec.begin(), aVec.end(), - [&aText](const OUString& n){ return n == aText; }); - if (!bFound) + if (std::find(aVec.begin(), aVec.end(), aText) == aVec.end()) { if ( bPrepend ) aVec.insert( aVec.begin(), aText );