Skip to content

Commit

Permalink
fix(io/buffer): super and initialized prop (#1917)
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsonk committed Feb 14, 2022
1 parent 1eb937a commit a9f6a1c
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions io/buffer.ts
Expand Up @@ -723,11 +723,7 @@ export class BufWriter extends AbstractBufBase implements Writer {
}

constructor(writer: Writer, size: number = DEFAULT_BUF_SIZE) {
if (size <= 0) {
size = DEFAULT_BUF_SIZE;
}
const buf = new Uint8Array(size);
super(buf);
super(new Uint8Array(size <= 0 ? DEFAULT_BUF_SIZE : size));
this.#writer = writer;
}

Expand Down Expand Up @@ -824,11 +820,7 @@ export class BufWriterSync extends AbstractBufBase implements WriterSync {
}

constructor(writer: WriterSync, size: number = DEFAULT_BUF_SIZE) {
if (size <= 0) {
size = DEFAULT_BUF_SIZE;
}
const buf = new Uint8Array(size);
super(buf);
super(new Uint8Array(size <= 0 ? DEFAULT_BUF_SIZE : size));
this.#writer = writer;
}

Expand Down

0 comments on commit a9f6a1c

Please sign in to comment.