mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-19 16:20:50 +00:00
Use adjacent_find to check adjacent parts
This commit is contained in:
parent
3674c97ebb
commit
574a26c63b
@ -917,18 +917,15 @@ void InOrderCoordinator<mode>::doHandleInitialAllRangesAnnouncement(InitialAllRa
|
|||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
/// Double check that there are no intersecting parts
|
/// Double check that there are no intersecting parts
|
||||||
{
|
{
|
||||||
auto part_it = all_parts_to_read.begin();
|
auto intersecting_part_it = std::adjacent_find(all_parts_to_read.begin(), all_parts_to_read.end(),
|
||||||
auto next_part_it = part_it;
|
[] (const Part & lhs, const Part & rhs)
|
||||||
if (next_part_it != all_parts_to_read.end())
|
|
||||||
++next_part_it;
|
|
||||||
while (next_part_it != all_parts_to_read.end())
|
|
||||||
{
|
{
|
||||||
chassert(part_it->description.info.isDisjoint(next_part_it->description.info),
|
return !lhs.description.info.isDisjoint(rhs.description.info);
|
||||||
fmt::format("Parts {} and {} intersect",
|
});
|
||||||
part_it->description.info.getPartNameV1(), next_part_it->description.info.getPartNameV1()));
|
|
||||||
++part_it;
|
if (intersecting_part_it != all_parts_to_read.end())
|
||||||
++next_part_it;
|
throw Exception(ErrorCodes::LOGICAL_ERROR, "Parts {} and {} intersect",
|
||||||
}
|
intersecting_part_it->description.info.getPartNameV1(), std::next(intersecting_part_it)->description.info.getPartNameV1());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user