Lines 315–323 at 120 (were 315–323 at 119)
315315 this.#lineText = storedArray(storage, "line-text"); 316316 this.#pathIndex = storedMap(storage, "path-index"); 317317 this.#moreDeleters = storedMap(storage, "more-deleters"); 318− this.#writers = storedMap(storage, "writers");
319− this.#readers = storedMap(storage, "readers");
320− this.#holders = storedMap(storage, "holders");
318+ this.#writersPages = storedLists<AtomId>(storage, "writers", (key) => key); 319+ this.#readersPages = storedLists<AtomId>(storage, "readers", (key) => key); 320+ this.#holdersPages = storedLists<AtomId>(storage, "holders", (key) => key); 321321 this.#dependents = storedMap(storage, "dependents"); 322322 this.#resolvers = storedMap(storage, "resolvers"); 323323 this.#together = storedMap(storage, "together"); Lines 421–431 at 120 (were 421–428 at 119)
421421 #deleter: NumberIndex = new Ints(); 422422 #moreDeleters: StateMap<number, number[]> = new Map(); 423423 #writers: StateMap<Key | number, AtomId | AtomId[]> = new Map(); 424+ #writersPages: ReturnType<typeof storedLists<AtomId>> | undefined; 424425 #readers: StateMap<Key | number, AtomId | AtomId[]> = new Map(); 426+ #readersPages: ReturnType<typeof storedLists<AtomId>> | undefined; 425427 #holders: StateMap<Key | number, AtomId | AtomId[]> = new Map(); 428+ #holdersPages: ReturnType<typeof storedLists<AtomId>> | undefined; 426429 #dependents: StateMap<AtomId, AtomId | AtomId[]> = new Map(); 427430 #resolvers: StateMap<AtomId, AtomId | AtomId[]> = new Map(); 428431 #together: StateMap<AtomId, TogetherLink[]> = new Map(); Lines 698–730 at 120 (were 695–712 at 119)
697700 writersOf(key: Key): readonly AtomId[] { 698− return listOf(this.#writers.get(this.#code(key)));
701+ return [...this.eachWriterOf(key)]; 703+ *eachWriterOf(key: Key): IterableIterator<AtomId> { 704+ const code = this.#code(key); 705+ if (this.#writersPages) yield* this.#writersPages.values(JSON.stringify([typeof code, code])); 706+ else yield* listOf(this.#writers.get(code)); 701709 /** Atoms whose implicit reads include the key. */ 702710 readersOf(key: Key): readonly AtomId[] { 703− return listOf(this.#readers.get(this.#code(key)));
711+ return [...this.eachReaderOf(key)]; 713+ *eachReaderOf(key: Key): IterableIterator<AtomId> { 714+ const code = this.#code(key); 715+ if (this.#readersPages) yield* this.#readersPages.values(JSON.stringify([typeof code, code])); 716+ else yield* listOf(this.#readers.get(code)); 706719 /** Atoms whose explicit holds include the key. */ 707720 holdersOf(key: Key): readonly AtomId[] { 708− return listOf(this.#holders.get(this.#code(key)));
721+ return [...this.eachHolderOf(key)]; 723+ *eachHolderOf(key: Key): IterableIterator<AtomId> { 724+ const code = this.#code(key); 725+ if (this.#holdersPages) yield* this.#holdersPages.values(JSON.stringify([typeof code, code])); 726+ else yield* listOf(this.#holders.get(code)); 711729 /** Every atom that inserts or deletes a line of the file, in seq order. */ 712730 atomsIn(file: string): readonly AtomId[] { Lines 1001–1021 at 120 (were 983–991 at 119)
9831001 if (this.#deleter.at(n) < 0) this.#deleter.set(n, seq); 9841002 else pushIndex(this.#moreDeleters, n, seq); 986− for (const key of new Set(atom.writes)) pushOne(this.#writers, this.#code(key), frozen.id);
987− for (const key of new Set(atom.reads)) pushOne(this.#readers, this.#code(key), frozen.id);
988− for (const key of new Set(atom.holds)) pushOne(this.#holders, this.#code(key), frozen.id);
1004+ for (const key of new Set(atom.writes)) { 1005+ const code = this.#code(key); 1006+ if (this.#writersPages) this.#writersPages.append(JSON.stringify([typeof code, code]), frozen.id); 1007+ else pushOne(this.#writers, code, frozen.id); 1009+ for (const key of new Set(atom.reads)) { 1010+ const code = this.#code(key); 1011+ if (this.#readersPages) this.#readersPages.append(JSON.stringify([typeof code, code]), frozen.id); 1012+ else pushOne(this.#readers, code, frozen.id); 1014+ for (const key of new Set(atom.holds)) { 1015+ const code = this.#code(key); 1016+ if (this.#holdersPages) this.#holdersPages.append(JSON.stringify([typeof code, code]), frozen.id); 1017+ else pushOne(this.#holders, code, frozen.id); 9891019 for (const d of deps) pushOne(this.#dependents, d, frozen.id); 9901020 for (const r of new Set(frozen.resolves)) pushOne(this.#resolvers, r, frozen.id); 9911021 const files = new Set<string>();