From: Chris Duncan Date: Sun, 10 Aug 2025 02:19:56 +0000 (-0700) Subject: Simplify account index swap. X-Git-Tag: v0.10.5~41^2~137 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=360777e79b643da6d265e9b5e3fb6463abf6b6b4;p=libnemo.git Simplify account index swap. --- diff --git a/src/lib/wallet/wallet.ts b/src/lib/wallet/wallet.ts index 4220301..bffd245 100644 --- a/src/lib/wallet/wallet.ts +++ b/src/lib/wallet/wallet.ts @@ -255,11 +255,7 @@ export class Wallet { * @returns {AccountList} Object with keys of account indexes and values of the corresponding Accounts */ async accounts (from: number = 0, to: number = from): Promise { - if (from > to) { - const swap = from - from = to - to = swap - } + if (from > to) [from, to] = [to, from] const output = new AccountList() const indexes: number[] = [] for (let i = from; i <= to; i++) {