|
|
@@ -333,12 +333,10 @@ public:
|
|
|
|
|
|
if constexpr (std::totally_ordered<A>) {
|
|
|
std::map<A, size_t> cache;
|
|
|
- size_t index = 0;
|
|
|
- for (A const & elem : document_.as_array()) {
|
|
|
+ for (auto const & [index, elem] : detail::enumerate(document_.as_array())) {
|
|
|
if (auto [it, created] = cache.emplace(elem, index); not created) {
|
|
|
return note(Status::Reject, "items ", it->second, " and ", index, " are equal");
|
|
|
}
|
|
|
- ++index;
|
|
|
}
|
|
|
} else {
|
|
|
auto array = document_.as_array();
|