* Inserts an item into the correct nested bucket, creating intermediate * bucket structures on demand. * @param {K} key key of item * @param {T} item the item * @returns {void}
(key, item)
| 92 | * @returns {void} |
| 93 | */ |
| 94 | _addInternal(key, item) { |
| 95 | let entry = this._map.get(key); |
| 96 | if (entry === undefined) { |
| 97 | entry = this._leaf |
| 98 | ? new SortableSet( |
| 99 | undefined, |
| 100 | /** @type {Comparator<T>} */ |
| 101 | (this._innerArgs[0]) |
| 102 | ) |
| 103 | : new LazyBucketSortedSet( |
| 104 | .../** @type {[GetKey<T, K>, Comparator<K>]} */ |
| 105 | (this._innerArgs) |
| 106 | ); |
| 107 | this._keys.add(key); |
| 108 | this._map.set(key, entry); |
| 109 | } |
| 110 | entry.add(item); |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * Removes an item from either the unsorted staging area or its resolved |
no test coverage detected