From 7a05bb5cfbf3560b828c226f4a3bad8c3826b039 Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Wed, 23 Mar 2022 18:47:42 +0100 Subject: Apply changes suggested by clang-tidy 11 --- test/utils/container_matchers.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'test/utils/container_matchers.hpp') diff --git a/test/utils/container_matchers.hpp b/test/utils/container_matchers.hpp index c52a7d16..42c0dfb4 100644 --- a/test/utils/container_matchers.hpp +++ b/test/utils/container_matchers.hpp @@ -155,12 +155,11 @@ class ContainerUnorderedMatcher : public Catch::MatcherBase { std::iter_swap(it_to_elem, last_to_check); return true; }; - for (auto const& element : lhs) { - if (not check_exists_and_remove(element)) { - return false; - } - } - return true; + return std::all_of(lhs.begin(), + lhs.end(), + [&check_exists_and_remove](auto const& element) { + return check_exists_and_remove(element); + }); } }; -- cgit v1.2.3