summaryrefslogtreecommitdiff
path: root/js/buffer.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/buffer.ts')
-rw-r--r--js/buffer.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/js/buffer.ts b/js/buffer.ts
index 551e8c4d4..15a26fb28 100644
--- a/js/buffer.ts
+++ b/js/buffer.ts
@@ -39,9 +39,10 @@ export class Buffer implements Reader, SyncReader, Writer, SyncWriter {
constructor(ab?: ArrayBuffer) {
if (ab == null) {
this.buf = new Uint8Array(0);
- } else {
- this.buf = new Uint8Array(ab);
+ return;
}
+
+ this.buf = new Uint8Array(ab);
}
/** bytes() returns a slice holding the unread portion of the buffer.