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).
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user