From 058ec4842c5a80e89dc1f713263c4d7538f5981b Mon Sep 17 00:00:00 2001 From: wlambooy Date: Tue, 14 Jan 2025 16:35:52 +0100 Subject: [PATCH] :art: Clang-Tidy suggestion --- test/algorithms/simulation/sidb/clustercomplete.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/test/algorithms/simulation/sidb/clustercomplete.cpp b/test/algorithms/simulation/sidb/clustercomplete.cpp index 859a27a7d..f32a3923b 100644 --- a/test/algorithms/simulation/sidb/clustercomplete.cpp +++ b/test/algorithms/simulation/sidb/clustercomplete.cpp @@ -98,15 +98,10 @@ static bool verify_clustercomplete_result_by_charge_indices(const charge_distribution_surface& qe_cds, const std::vector>& cc_cdss) noexcept { - for (const auto& cc_cds : cc_cdss) - { - if (cc_cds.get_charge_index_and_base().first == qe_cds.get_charge_index_and_base().first) - { - return true; - } - } - - return false; + return std::any_of(cc_cdss.cbegin(), cc_cdss.cend(), + [&](const auto& cc_cds) { + return cc_cds.get_charge_index_and_base().first == qe_cds.get_charge_index_and_base().first; + }); } TEMPLATE_TEST_CASE("ClusterComplete simulation of a 4 DB layout with a positive charge", "[clustercomplete]",