From 2dd5ccf24c931582937533ec56da29703b717d9c Mon Sep 17 00:00:00 2001 From: Pedro Maciel Date: Mon, 13 Nov 2023 12:27:44 +0000 Subject: [PATCH] Fix logic --- src/atlas/redistribution/detail/RedistributeGeneric.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/atlas/redistribution/detail/RedistributeGeneric.cc b/src/atlas/redistribution/detail/RedistributeGeneric.cc index 9e86fff15..d1aa54888 100644 --- a/src/atlas/redistribution/detail/RedistributeGeneric.cc +++ b/src/atlas/redistribution/detail/RedistributeGeneric.cc @@ -121,9 +121,9 @@ std::vector getUidVec(const FunctionSpace& functionspace) { // Check UIDs are unique. if (ATLAS_BUILD_TYPE_DEBUG) { const size_t vecSize = uidVec.size(); - std::unique(uidVec.begin(), uidVec.end(), - [](const IdxUid& a, const IdxUid& b) { return a.second == b.second; }); - ATLAS_ASSERT(uidVec.size() == vecSize, "Unique ID set has duplicate members"); + auto first_duplicate = std::adjacent_find( + uidVec.begin(), uidVec.end(), [](const IdxUid& a, const IdxUid& b) { return a.second == b.second; }); + ATLAS_ASSERT(uidVec.end() == first_duplicate, "Unique ID set has duplicate members"); } return uidVec;