Process acceptable subranges interleaved
This commit is contained in:
11
Internal.h
11
Internal.h
@@ -49,6 +49,17 @@ operator<=>(const std::span<const uint8_t> &lhs,
|
||||
return lhs.size() <=> size_t(rhs.len);
|
||||
}
|
||||
|
||||
[[nodiscard]] inline auto operator<=>(const ConflictSet::Key &lhs,
|
||||
const ConflictSet::Key &rhs) noexcept {
|
||||
int cl = std::min<int>(lhs.len, rhs.len);
|
||||
if (cl > 0) {
|
||||
if (auto c = memcmp(lhs.p, rhs.p, cl) <=> 0; c != 0) {
|
||||
return c;
|
||||
}
|
||||
}
|
||||
return lhs.len <=> rhs.len;
|
||||
}
|
||||
|
||||
// This header contains code that we want to reuse outside of ConflictSet.cpp or
|
||||
// want to exclude from coverage since it's only testing related.
|
||||
|
||||
|
Reference in New Issue
Block a user