From 1e64a43a42dafa2d6338d850e9b005b742ee3562 Mon Sep 17 00:00:00 2001 From: Matt Vogel Date: Thu, 19 Oct 2023 22:24:11 -0400 Subject: [PATCH] feat: 2x preprocess speed --- roam/index.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/roam/index.ts b/roam/index.ts index 13720f497cb20..d045bdcdbebd6 100644 --- a/roam/index.ts +++ b/roam/index.ts @@ -171,10 +171,9 @@ function resolveBlockRef(blockLocations: Map, sourceBlockUID: return strippedSourceBlockString } -function preprocess(pages: RoamPage[]): [Map, Map] { +function preprocess(pages: RoamPage[]): Map { // preprocess/map the graph so each block can be quickly found const blockLocations: Map = new Map(); - const toPostProcessblockLocations: Map = new Map(); function processBlock(page: RoamPage, block: RoamBlock) { if (block[':block/uid']) { @@ -186,10 +185,6 @@ function preprocess(pages: RoamPage[]): [Map, Map, Map { console.log("~~pages downloaded"); console.log("~~~~starting block preprocess"); // PRE-PROCESS: map the blocks for easy lookup // - const [blockLocations, toPostProcess] = preprocess(allPages); + const blockLocations = preprocess(allPages); console.log("~~block preprocess finished"); const filteredPages = findPagesByTitles(allPages, pages)