We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1404aaf commit b8d9f74Copy full SHA for b8d9f74
src/InMemoryProvider.ts
@@ -768,17 +768,16 @@ class InMemoryIndex extends DbIndexFTSFromRangeQueries {
768
break;
769
}
770
771
+ const pushToResult = (v: ItemType) => values.push(v);
772
if (this.isUniqueIndex()) {
- values = values.concat(this._indexTree.get(key) as ItemType[]);
773
+ (this._indexTree.get(key) as ItemType[]).forEach(pushToResult);
774
} else {
- values = values.concat(
775
- this._getKeyValues(
776
- key,
777
- limit - values.length,
778
- Math.abs(offset),
779
- reverse
780
- )
781
- );
+ this._getKeyValues(
+ key,
+ limit - values.length,
+ Math.abs(offset),
+ reverse
+ ).forEach(pushToResult);
782
783
if (offset < 0) {
784
offset = 0;
0 commit comments