Skip to content

Commit 2972ca6

Browse files
jensjohacommit-bot@chromium.org
authored andcommitted
Fix continue in invalidation logic
When invalidating changed files in frontend server, the state prior to this CL was that a continue would jump to the next byte, not the next file after it had seen that the file had changed. Thus it could possibly invalidate the same file several times. Change-Id: If6fb1042248d26a3ffe905b39fa3c3603198ca37 Reviewed-on: https://dart-review.googlesource.com/60245 Commit-Queue: Jens Johansen <[email protected]> Reviewed-by: Aske Simon Christensen <[email protected]>
1 parent c54a302 commit 2972ca6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pkg/vm/lib/frontend_server.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,25 +385,26 @@ class FrontendCompiler implements CompilerInterface {
385385
return null;
386386
}
387387

388+
nextUri:
388389
for (Uri uri in component.uriToSource.keys) {
389-
if (uri == null || '$uri' == '') continue;
390+
if (uri == null || '$uri' == '') continue nextUri;
390391

391392
final List<int> oldBytes = component.uriToSource[uri].source;
392393
final FileSystemEntity entity =
393394
_compilerOptions.fileSystem.entityForUri(uri);
394395
if (!await entity.exists()) {
395396
_generator.invalidate(uri);
396-
continue;
397+
continue nextUri;
397398
}
398399
final List<int> newBytes = await entity.readAsBytes();
399400
if (oldBytes.length != newBytes.length) {
400401
_generator.invalidate(uri);
401-
continue;
402+
continue nextUri;
402403
}
403404
for (int i = 0; i < oldBytes.length; ++i) {
404405
if (oldBytes[i] != newBytes[i]) {
405406
_generator.invalidate(uri);
406-
continue;
407+
continue nextUri;
407408
}
408409
}
409410
}

0 commit comments

Comments
 (0)