diff options
author | Dr. David Alan Gilbert <dave@treblig.org> | 2023-05-24 13:57:16 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-05-29 14:48:04 +0200 |
commit | da398ad3bb511e33451f9d3bf24b0c5abd55ce25 (patch) | |
tree | f7d7b4f1bfa5099d8129a2a93ad3804a150120a6 /svx | |
parent | 583c3fcea50b69ca9d3cd866050c9e722a8f780b (diff) |
replace find_if by any_of
A few cases where find_if is used just to test if there are any
matches; use any_of as per
tdf#153109
In document3 we can merge two identical loops.
In langbox we can optimise the arg capture (Arkadiy's suggestion)
Change-Id: I480b80ec1b859980b651c6d727e7fb5d01d390e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152201
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/langbox.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index 76d9b3de1fe5..b489ea58a546 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -183,8 +183,8 @@ void SvxLanguageBox::AddLanguages(const std::vector< LanguageType >& rLanguageTy weld::ComboBoxEntry aNewEntry(BuildEntry(nLang)); if (aNewEntry.sString.isEmpty()) continue; - if (std::find_if(rEntries.begin(), rEntries.end(), - [=](const weld::ComboBoxEntry& rEntry){ return rEntry.sId == aNewEntry.sId; }) != rEntries.end()) + if (std::any_of(rEntries.begin(), rEntries.end(), + [&](const weld::ComboBoxEntry& rEntry){ return rEntry.sId == aNewEntry.sId; })) continue; rEntries.push_back(aNewEntry); } |