mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Merge pull request #32972 from kitaisreal/containers-iteration-fix-erase
Containers iteration fix erase
This commit is contained in:
commit
ebff389701
@ -209,7 +209,7 @@ void Block::eraseImpl(size_t position)
|
||||
for (auto it = index_by_name.begin(); it != index_by_name.end();)
|
||||
{
|
||||
if (it->second == position)
|
||||
index_by_name.erase(it++);
|
||||
it = index_by_name.erase(it);
|
||||
else
|
||||
{
|
||||
if (it->second > position)
|
||||
|
@ -253,7 +253,7 @@ void DiskMemory::clearDirectory(const String & path)
|
||||
throw Exception(
|
||||
"Failed to clear directory '" + path + "'. " + iter->first + " is a directory", ErrorCodes::CANNOT_DELETE_DIRECTORY);
|
||||
|
||||
files.erase(iter++);
|
||||
iter = files.erase(iter);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -957,7 +957,7 @@ void TreeRewriterResult::collectUsedColumns(const ASTPtr & query, bool is_select
|
||||
unknown_required_source_columns.erase(column_name);
|
||||
|
||||
if (!required.count(column_name))
|
||||
source_columns.erase(it++);
|
||||
it = source_columns.erase(it);
|
||||
else
|
||||
++it;
|
||||
}
|
||||
@ -973,7 +973,7 @@ void TreeRewriterResult::collectUsedColumns(const ASTPtr & query, bool is_select
|
||||
if (column)
|
||||
{
|
||||
source_columns.push_back(*column);
|
||||
unknown_required_source_columns.erase(it++);
|
||||
it = unknown_required_source_columns.erase(it);
|
||||
}
|
||||
else
|
||||
++it;
|
||||
|
@ -16,7 +16,7 @@ NameSet removeDuplicateColumns(NamesAndTypesList & columns)
|
||||
if (names.emplace(it->name).second)
|
||||
++it;
|
||||
else
|
||||
columns.erase(it++);
|
||||
it = columns.erase(it);
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ bool ActiveDataPartSet::add(const String & name, Strings * out_replaced_parts)
|
||||
|
||||
if (out_replaced_parts)
|
||||
out_replaced_parts->push_back(it->second);
|
||||
part_info_to_name.erase(it++);
|
||||
it = part_info_to_name.erase(it);
|
||||
}
|
||||
|
||||
if (out_replaced_parts)
|
||||
@ -61,7 +61,7 @@ bool ActiveDataPartSet::add(const String & name, Strings * out_replaced_parts)
|
||||
assert(part_info != it->first);
|
||||
if (out_replaced_parts)
|
||||
out_replaced_parts->push_back(it->second);
|
||||
part_info_to_name.erase(it++);
|
||||
it = part_info_to_name.erase(it);
|
||||
}
|
||||
|
||||
if (it != part_info_to_name.end() && !part_info.isDisjoint(it->first))
|
||||
|
@ -1033,7 +1033,7 @@ void ReplicatedMergeTreeQueue::removePartProducingOpsInRange(
|
||||
min_unprocessed_insert_time_changed, max_processed_insert_time_changed, lock);
|
||||
|
||||
(*it)->removed_by_other_entry = true;
|
||||
queue.erase(it++);
|
||||
it = queue.erase(it);
|
||||
++removed_entries;
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user