Skip to content

Commit c53c498

Browse files
committed
Performance fix
1 parent ff1eeac commit c53c498

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ function createQuerier() {
300300
return value != undefined && value != null;
301301
}
302302
let subQueryCounter = 0;
303-
303+
let memoHits = 0;
304304
const memo = new Map<QNode, Map<NodePath | PrimitiveValue, Result[]>>();
305305

306306
function resolveDirectly(node: QNode, path: NodePath) : Result[] {
@@ -337,6 +337,7 @@ function createQuerier() {
337337
for (const path of paths) {
338338
if (isNodePath(path)) {
339339
if (memo.has(startNode) && memo.get(startNode)!.has(path)) {
340+
memoHits++;
340341
result.push(...memo.get(startNode)!.get(path)!);
341342
} else {
342343
const subQueryKey = "subquery-" + subQueryCounter++;

src/traverse.ts

Whitespace-only changes.

0 commit comments

Comments
 (0)