diff --git a/static/js/lazy_set.js b/static/js/lazy_set.js index df39ce916e..7b10ac9d5a 100644 --- a/static/js/lazy_set.js +++ b/static/js/lazy_set.js @@ -49,13 +49,15 @@ export class LazySet { _make_set() { if (this.data.set !== undefined) { - return; + return this.data.set; } this.data = { arr: undefined, set: new Set(this.data.arr), }; + + return this.data.set; } map(f) { @@ -69,15 +71,15 @@ export class LazySet { } add(v) { - this._make_set(); + const set = this._make_set(); const val = this._clean(v); - this.data.set.add(val); + set.add(val); } delete(v) { - this._make_set(); + const set = this._make_set(); const val = this._clean(v); - return this.data.set.delete(val); + return set.delete(val); } _clean(v) {