diff --git a/src/abstract/utils.ts b/src/abstract/utils.ts index 0389c3e..62a3fd0 100644 --- a/src/abstract/utils.ts +++ b/src/abstract/utils.ts @@ -141,9 +141,8 @@ export function concatBytes(...arrays: Uint8Array[]): Uint8Array { if (!isBytes(a)) throw new Error('Uint8Array expected'); sum += a.length; } - let res = new Uint8Array(sum); - let pad = 0; - for (let i = 0; i < arrays.length; i++) { + const res = new Uint8Array(sum); + for (let i = 0, pad = 0; i < arrays.length; i++) { const a = arrays[i]; res.set(a, pad); pad += a.length;