@@ -324,7 +324,7 @@ mutable class Context private {
324
324
mutable newDirs: SortedSet<DirName> = SortedSet[],
325
325
mutable globals: SortedMap<String, File> = SortedMap[],
326
326
private mutable persistents: SortedMap<String, File> = SortedMap[],
327
- private mutable dirty: SortedMap<DirName, SortedSet<Key>> = SortedMap [],
327
+ private mutable dirsWithDirty: SortedSet<DirName> = SortedSet [],
328
328
private mutable dirtyReaders: /* parentName => childName => keys */ SortedMap<
329
329
DirName,
330
330
SortedMap<DirName, SortedSet<Key>>,
@@ -435,7 +435,7 @@ mutable class Context private {
435
435
newDirs => this.newDirs,
436
436
globals => this.globals,
437
437
persistents => this.persistents,
438
- dirty => this.dirty ,
438
+ dirsWithDirty => this.dirsWithDirty ,
439
439
dirtyReaders => this.dirtyReaders,
440
440
canReuse => this.canReuse,
441
441
arrowStack => this.arrowStack,
@@ -466,7 +466,7 @@ mutable class Context private {
466
466
this.!newDirs = ctx.newDirs;
467
467
this.!globals = ctx.globals;
468
468
this.!persistents = ctx.persistents;
469
- this.!dirty = ctx.dirty ;
469
+ this.!dirsWithDirty = ctx.dirsWithDirty ;
470
470
this.!dirtyReaders = ctx.dirtyReaders;
471
471
this.!canReuse = ctx.canReuse;
472
472
this.!arrowStack = ctx.arrowStack;
@@ -583,7 +583,7 @@ mutable class Context private {
583
583
* recomputed.
584
584
*
585
585
* - dirtyReaders are files that are made dirty because of a read access
586
- * - dirty are files that are made dirty because of a Map.
586
+ * - dirsWithDirty are dirs containing files that are made dirty because of a Map.
587
587
*/
588
588
/*****************************************************************************/
589
589
mutable fun updateDirtyReaders(path: Path): void {
@@ -666,11 +666,8 @@ mutable class Context private {
666
666
this.!lazyGets = this.lazyGets.set(Path::create(dirName, key))
667
667
}
668
668
669
- mutable fun addDirty(dirName: DirName, key: Key): void {
670
- this.!dirty[dirName] = this.dirty.maybeGet(dirName) match {
671
- | None() -> SortedSet[key]
672
- | Some(set) -> set.set(key)
673
- }
669
+ mutable fun addDirWithDirty(dirName: DirName): void {
670
+ this.!dirsWithDirty = this.dirsWithDirty.set(dirName);
674
671
}
675
672
676
673
mutable fun update(): void {
@@ -694,7 +691,13 @@ mutable class Context private {
694
691
loop {
695
692
this.toUpdate.removeMin() match {
696
693
| None() ->
697
- this.!dirty = SortedMap[];
694
+ for (dirName in this.dirsWithDirty) {
695
+ this.unsafeMaybeGetEagerDir(dirName) match {
696
+ | None() -> void
697
+ | Some(dir) -> this.setDir(dir.resetDirty())
698
+ }
699
+ };
700
+ this.!dirsWithDirty = SortedSet[];
698
701
this.!dirtyReaders = SortedMap[];
699
702
withPostponables = this.checkPostponables();
700
703
withPre = this.updatePre();
@@ -717,7 +720,6 @@ mutable class Context private {
717
720
};
718
721
EagerDir::update(
719
722
this,
720
- this.dirty.maybeGet(parentName),
721
723
this.dirtyReaders.maybeGet(parentName),
722
724
parentName,
723
725
parentMaps,
0 commit comments