sw/source/core/doc/list.cxx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
New commits: commit b0b796f434d317e43acc4ac8b82377625e362d73 Author: shark <[email protected]> AuthorDate: Sat Jan 17 12:48:00 2026 +0000 Commit: David Gilbert <[email protected]> CommitDate: Wed Jan 28 23:48:14 2026 +0100 tdf#170269 use ranges::any_of to simplify loops Change-Id: I31c4899de9b02f3ec7ec43307733a1d80731f735 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197518 Reviewed-by: David Gilbert <[email protected]> Tested-by: Jenkins diff --git a/sw/source/core/doc/list.cxx b/sw/source/core/doc/list.cxx index b01a2dcf5a80..ea21909bebab 100644 --- a/sw/source/core/doc/list.cxx +++ b/sw/source/core/doc/list.cxx @@ -76,14 +76,9 @@ SwList::~SwList() COVERITY_NOEXCEPT_FALSE bool SwList::HasNodes() const { - for (auto const& rNumberTree : maListTrees) - { - if (rNumberTree.pRoot->GetChildCount() != 0) - { - return true; - } - } - return false; + return std::ranges::any_of(maListTrees, [] (auto const& rNumberTree) { + return rNumberTree.pRoot->GetChildCount() != 0; + }); } void SwList::InsertListItem(SwNodeNum& rNodeNum, SwListRedlineType const eRedline,
