From cf1532965ea1d16929ed2291a9b737a4ce74caac Mon Sep 17 00:00:00 2001 From: Andre Staltz Date: Fri, 1 Mar 2024 14:56:44 +0200 Subject: [PATCH] tiny refactor in Ghosts --- lib/ghosts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ghosts.js b/lib/ghosts.js index 6225412..46d9b28 100644 --- a/lib/ghosts.js +++ b/lib/ghosts.js @@ -52,7 +52,7 @@ class Ghosts { // neither fully parallel if (FS.existsSync(basePath)) { const done = multicb({ pluck: 1 }) - FS.readdirSync(basePath).forEach((tangleID) => { + for (const tangleID of FS.readdirSync(basePath)) { const cb = done() this.#read(tangleID, (err, map) => { // prettier-ignore @@ -60,7 +60,7 @@ class Ghosts { this.#maps.set(tangleID, map) cb() }) - }) + } done((err, _) => { // prettier-ignore if (err) throw new Error('GhostDB failed to load', { cause: err })