mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 16:41:07 +00:00
![]() The way runtime/platform/hashmap.h:HashMap was implemented so far did not allow deleting elements while iterating over the map. If one iterated like this HashMap::Entry* cursor = map.Start(); while (cursor != NULL) { if (cond) { map.Remove(cursor->key, cursor->hash); } cursor = map.Next(cursor); } Then the iteration `cursor` will skip elements. This is due to the fact that `HashMap::Remove()` is left-rotating elements in certain cases and `HashMap::Next()` will unconditionally advance to the next position in the backing store. PROBLEM IS: There was existing code which did remove elements while iterating over a HashMap. R=fschneider@google.com Review URL: https://codereview.chromium.org/2533303005 . |
||
---|---|---|
.. | ||
bin | ||
include | ||
lib | ||
observatory | ||
platform | ||
tests/vm | ||
third_party | ||
tools | ||
vm | ||
.gitignore | ||
BUILD.gn | ||
codereview.settings | ||
CPPLINT.cfg | ||
dart-runtime.gyp | ||
PRESUBMIT.py |