Skip to content

Commit

Permalink
Fix logic
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaciel authored and wdeconinck committed Nov 13, 2023
1 parent 2ce9d2d commit 2dd5ccf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/atlas/redistribution/detail/RedistributeGeneric.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ std::vector<IdxUid> 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;
Expand Down

0 comments on commit 2dd5ccf

Please sign in to comment.