Skip to content

Commit

Permalink
Fix logic
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaciel committed Nov 13, 2023
1 parent 94b6b5d commit 99d7ca0
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 99d7ca0

Please sign in to comment.