]> zoso.dev Git - libnemo.git/commitdiff
Performance test does not show a huge improvement (half a second over a million recor...
authorChris Duncan <chris@zoso.dev>
Mon, 11 Nov 2024 05:35:13 +0000 (21:35 -0800)
committerChris Duncan <chris@zoso.dev>
Mon, 11 Nov 2024 05:35:13 +0000 (21:35 -0800)
src/lib/wallet.ts

index 32242cb4539a6cd151bfd2124a772b26a887351b..3ed559d22f79ba81267826e758810ba39e7e0299 100644 (file)
@@ -72,17 +72,11 @@ abstract class Wallet {
                        from = to\r
                        to = swap\r
                }\r
-               const accountQueue = []\r
                for (let i = from; i <= to; i++) {\r
                        if (this.#accounts[i] == null) {\r
-                               accountQueue.push(new Promise(resolve => {\r
-                                       this.ckd(i).then(account => this.#accounts[i] = account).then(resolve)\r
-                               }))\r
+                               this.#accounts[i] = await this.ckd(i)\r
                        }\r
                }\r
-               if (accountQueue.length > 0) {\r
-                       await Promise.allSettled(accountQueue)\r
-               }\r
                return this.#accounts.slice(from, to + 1)\r
        }\r
 \r