Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Unified Diff: pkg/analyzer/lib/src/dart/analysis/file_state.dart

Issue 2833153002: Restore ??= for the timer in file state. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/analysis/file_state.dart
diff --git a/pkg/analyzer/lib/src/dart/analysis/file_state.dart b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
index 3984d3acf8a275e8b7efc59ec246e37254300b5a..44100e268ddd5eb1d4a7d8ef0bbcb1e7eb0a551c 100644
--- a/pkg/analyzer/lib/src/dart/analysis/file_state.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
@@ -865,17 +865,14 @@ class FileSystemState {
void _scheduleKnownFilesSetChange() {
Duration delay = _knownFilesSetChangesDelay ?? new Duration(seconds: 1);
- // Note: we don't use ??= here due to issue #29393
- if (_knownFilesSetChangesTimer == null) {
- _knownFilesSetChangesTimer = new Timer(delay, () {
- Set<String> addedFiles = _addedKnownFiles.toSet();
- Set<String> removedFiles = new Set<String>();
- _knownFilesSetChangesController
- .add(new KnownFilesSetChange(addedFiles, removedFiles));
- _addedKnownFiles.clear();
- _knownFilesSetChangesTimer = null;
- });
- }
+ _knownFilesSetChangesTimer ??= new Timer(delay, () {
+ Set<String> addedFiles = _addedKnownFiles.toSet();
+ Set<String> removedFiles = new Set<String>();
+ _knownFilesSetChangesController
+ .add(new KnownFilesSetChange(addedFiles, removedFiles));
+ _addedKnownFiles.clear();
+ _knownFilesSetChangesTimer = null;
+ });
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698