Unverified Commit 0628a1fb authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Eliminiate concurrent map key set modification (#18284)

Iterates over a copy of the dirty entries list rather than the original,
in order to avoid the potential for a concurrent modification exception
when fileUris are removed/added later in the loop.

This occurs when non-asset URIs (Dart sources) are listed in the dirty
set when --preview-dart-2 is enabled (the default).
parent 3c25817b
......@@ -485,7 +485,7 @@ class DevFS {
// that it is initiated by user key press).
final List<String> invalidatedFiles = <String>[];
final Set<Uri> filesUris = new Set<Uri>();
for (Uri uri in dirtyEntries.keys) {
for (Uri uri in dirtyEntries.keys.toList()) {
if (!uri.path.startsWith(assetBuildDirPrefix)) {
final DevFSContent content = dirtyEntries[uri];
if (content is DevFSFileContent) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment