Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions io/buffer.ts
Original file line number Diff line number Diff line change
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