]> git.codecow.com Git - libnemo.git/commitdiff
Discard unnecessary else keyword.
authorChris Duncan <chris@codecow.com>
Fri, 15 May 2026 08:07:11 +0000 (01:07 -0700)
committerChris Duncan <chris@codecow.com>
Fri, 15 May 2026 08:07:11 +0000 (01:07 -0700)
src/lib/crypto/bip44.ts

index 040bdc614eeb31430e0637ce082ec9efebdd4e69..2b27e0e400f6fc3050a47fd2379ed2ad9cfd2902 100644 (file)
@@ -111,18 +111,17 @@ function childKey (curve: Curve, pk: Bytes, I: ArrayBuffer): ExtendedKey {
        const IR = I.slice(I.byteLength / 2)
        if (curve === 'ed25519 seed') {
                return ({ privateKey: IL, chainCode: IR })
-       } else {
-               const ILparsed = parse256(new Uint8Array(IL))
-               if (ILparsed >= Point.CURVE().n) {
-                       throw new Error('Invalid child key is greater than the order of the curve')
-               }
-               const pkParsed = parse256(pk)
-               const childKey = (ILparsed + pkParsed) % Point.CURVE().n
-               if (childKey === 0n) {
-                       throw new Error('Invalid child key is zero')
-               }
-               return ({ privateKey: ser256(childKey).buffer, chainCode: IR })
        }
+       const ILparsed = parse256(new Uint8Array(IL))
+       if (ILparsed >= Point.CURVE().n) {
+               throw new Error('Invalid child key is greater than the order of the curve')
+       }
+       const pkParsed = parse256(pk)
+       const childKey = (ILparsed + pkParsed) % Point.CURVE().n
+       if (childKey === 0n) {
+               throw new Error('Invalid child key is zero')
+       }
+       return ({ privateKey: ser256(childKey).buffer, chainCode: IR })
 }
 
 function ser32 (integer: number): Bytes {