]> git.codecow.com Git - libnemo.git/commitdiff
Simplify account index swap.
authorChris Duncan <chris@zoso.dev>
Sun, 10 Aug 2025 02:19:56 +0000 (19:19 -0700)
committerChris Duncan <chris@zoso.dev>
Sun, 10 Aug 2025 02:19:56 +0000 (19:19 -0700)
src/lib/wallet/wallet.ts

index 4220301a626b38c6f18337714484411cc72506c1..bffd2456243f9cedbf157a599008b914bffcadca 100644 (file)
@@ -255,11 +255,7 @@ export class Wallet {
        * @returns {AccountList} Object with keys of account indexes and values of the corresponding Accounts\r
        */\r
        async accounts (from: number = 0, to: number = from): Promise<AccountList> {\r
-               if (from > to) {\r
-                       const swap = from\r
-                       from = to\r
-                       to = swap\r
-               }\r
+               if (from > to) [from, to] = [to, from]\r
                const output = new AccountList()\r
                const indexes: number[] = []\r
                for (let i = from; i <= to; i++) {\r