From bcd64e87e701ef00a85f5ae2141ce4baa661024d Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Mon, 14 Jul 2025 09:44:27 -0700 Subject: [PATCH] Use for loop instead of map function for performance. --- src/lib/wallets/blake2b-wallet.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/wallets/blake2b-wallet.ts b/src/lib/wallets/blake2b-wallet.ts index ab0dff3..5dfed71 100644 --- a/src/lib/wallets/blake2b-wallet.ts +++ b/src/lib/wallets/blake2b-wallet.ts @@ -159,13 +159,14 @@ export class Blake2bWallet extends Wallet { * @returns {Promise} */ async ckd (indexes: number[]): Promise { - const results = indexes.map(index => { + const results = [] + for (const index of indexes) { const indexHex = index.toString(16).padStart(8, '0').toUpperCase() const inputHex = `${bytes.toHex(this.seed)}${indexHex}`.padStart(72, '0') const inputBytes = hex.toBytes(inputHex) const privateKey: string = new Blake2b(32).update(inputBytes).digest('hex') - return { privateKey, index } - }) + results.push({ privateKey, index }) + } return results } } -- 2.47.3