Browse Source

!3106 Optimization for map_data_.clear()

Merge pull request !3106 from Kang/optimization
tags/v0.6.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
b02fd3d8bc
2 changed files with 6 additions and 2 deletions
  1. +3
    -1
      mindspore/ccsrc/utils/ordered_map.h
  2. +3
    -1
      mindspore/ccsrc/utils/ordered_set.h

+ 3
- 1
mindspore/ccsrc/utils/ordered_map.h View File

@@ -88,7 +88,9 @@ class OrderedMap {
}

void clear() {
map_data_.clear();
if (!map_data_.empty()) {
map_data_.clear();
}
sequential_data_.clear();
}



+ 3
- 1
mindspore/ccsrc/utils/ordered_set.h 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();
}



Loading…
Cancel
Save