summaryrefslogtreecommitdiff
path: root/js/buffer.ts
diff options
context:
space:
mode:
authorTomislav Fabeta <tomislav.fabeta@gmail.com>2019-04-22 15:37:49 +0100
committerRyan Dahl <ry@tinyclouds.org>2019-04-22 10:37:49 -0400
commitd9408017541ffe6c86f4904973c22f829ade1ac4 (patch)
tree509cdd230d442ca70aa2640ac05f27c248ed3c0e /js/buffer.ts
parent1d4b92ac85d8c850270ca859f928404c72c0a49a (diff)
Simplify logic in URLSearchParams, Buffer, Console (#2174)
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.