Skip to content

Commit

Permalink
style: inline WASMBufferPointer#subarray() end default
Browse files Browse the repository at this point in the history
  • Loading branch information
TTtie committed Sep 30, 2024
1 parent a0f0957 commit f759592
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions wasm.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ class WASMBufferPointer {
_free(this._ptr);
}

subarray(start, end) {
if (end === undefined) end = this._byteLength;
subarray(start, end = this._byteLength) {
if (start > end) throw new RangeError("start must be less than or equal to end");
return new WASMBufferPointer(this._ptr + start, end - start);
}
Expand Down

0 comments on commit f759592

Please sign in to comment.