Improved readability a little bit (MergeTreeData::getActiveContainingPart).

This commit is contained in:
Vladimir Chebotarev 2019-10-16 22:01:50 +03:00 committed by GitHub
parent dfe297b93f
commit 512e97ddb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2488,12 +2488,12 @@ void MergeTreeData::throwInsertIfNeeded() const
MergeTreeData::DataPartPtr MergeTreeData::getActiveContainingPart(
const MergeTreePartInfo & part_info, MergeTreeData::DataPartState state, DataPartsLock & /*lock*/)
{
auto committed_parts_range = getDataPartsStateRange(state);
auto current_state_parts_range = getDataPartsStateRange(state);
/// The part can be covered only by the previous or the next one in data_parts.
auto it = data_parts_by_state_and_info.lower_bound(DataPartStateAndInfo{state, part_info});
if (it != committed_parts_range.end())
if (it != current_state_parts_range.end())
{
if ((*it)->info == part_info)
return *it;
@ -2501,7 +2501,7 @@ MergeTreeData::DataPartPtr MergeTreeData::getActiveContainingPart(
return *it;
}
if (it != committed_parts_range.begin())
if (it != current_state_parts_range.begin())
{
--it;
if ((*it)->info.contains(part_info))