diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-08-02 13:02:07 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-08-02 13:02:07 +0200 |
commit | f9a9da6cdb6e864f04532fd1d1ab3e646319fc2d (patch) | |
tree | d0542fcdf558552f23b8baa49f4f981bf23d1883 /gui/treemodel.cc | |
parent | 2b3f363e8975e80bb56e6adaea5604ab8fce164c (diff) | |
parent | 81ee55c7eb2f153ba01a6ff8aba2bffc54daa9dc (diff) | |
download | nextpnr-f9a9da6cdb6e864f04532fd1d1ab3e646319fc2d.tar.gz nextpnr-f9a9da6cdb6e864f04532fd1d1ab3e646319fc2d.tar.bz2 nextpnr-f9a9da6cdb6e864f04532fd1d1ab3e646319fc2d.zip |
Merge branch 'master' of github.com:YosysHQ/nextpnr into reroute
Diffstat (limited to 'gui/treemodel.cc')
-rw-r--r-- | gui/treemodel.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gui/treemodel.cc b/gui/treemodel.cc index 900d5101..33dd6a96 100644 --- a/gui/treemodel.cc +++ b/gui/treemodel.cc @@ -70,12 +70,14 @@ void IdStringList::updateElements(Context *ctx, std::vector<IdString> elements) } // For any elements that are in managed_ but not in new, delete them. - for (auto &pair : managed_) { - if (element_set.count(pair.first) != 0) { - continue; + auto it = managed_.begin(); + while (it != managed_.end()) { + if (element_set.count(it->first) != 0) { + ++it; + } else { + it = managed_.erase(it); + changed = true; } - managed_.erase(pair.first); - changed = true; } // Return early if there are no changes. |