Optimization for map_data_.clear()

This commit is contained in:
wuyongkang 2020-07-16 09:43:36 +08:00
parent 8300802b95
commit 7c1b44731e
2 changed files with 6 additions and 2 deletions

View File

@ -88,7 +88,9 @@ class OrderedMap {
}
void clear() {
map_data_.clear();
if (!map_data_.empty()) {
map_data_.clear();
}
sequential_data_.clear();
}

View File

@ -127,7 +127,9 @@ class OrderedSet {
// Clear the elements
void clear() {
mapped_data_.clear();
if (!mapped_data_.empty()) {
mapped_data_.clear();
}
ordered_data_.clear();
}