Skip to content

Commit

Permalink
fix: View changed not propagating
Browse files Browse the repository at this point in the history
  • Loading branch information
arv committed Mar 15, 2024
1 parent b5c52d7 commit 78faf24
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/zql/ivm/view/tree-view.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {PersistentTreap} from '@vlcn.io/ds-and-algos/PersistentTreap';
import {AbstractView} from './abstract-view.js';
import {Materialite} from '../materialite.js';
import {Treap} from '@vlcn.io/ds-and-algos/Treap';
import {Comparator, ITree} from '@vlcn.io/ds-and-algos/types';
import {DifferenceStream} from '../graph/difference-stream.js';
import {Version} from '../types.js';
import {Materialite} from '../materialite.js';
import {Multiset} from '../multiset.js';
import {Comparator, ITree} from '@vlcn.io/ds-and-algos/types';
import {Treap} from '@vlcn.io/ds-and-algos/Treap';
import {Version} from '../types.js';
import {AbstractView} from './abstract-view.js';

/**
* A sink that maintains the list of values in-order.
Expand Down Expand Up @@ -65,7 +65,7 @@ class AbstractTreeView<T> extends AbstractView<T, T[]> {

let newData = this.#data;
for (const c of collections) {
[changed, newData] = this.#sink(c, newData) || changed;
[changed, newData] = this.#sink(c, newData, changed);
}
this.#data = newData;

Expand All @@ -78,8 +78,7 @@ class AbstractTreeView<T> extends AbstractView<T, T[]> {
}
}

#sink(c: Multiset<T>, data: ITree<T>): [boolean, ITree<T>] {
let changed = false;
#sink(c: Multiset<T>, data: ITree<T>, changed: boolean): [boolean, ITree<T>] {
const iterator = c.entries[Symbol.iterator]();
let next;

Expand Down

0 comments on commit 78faf24

Please sign in to comment.