We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BinaryReader.bytes() uses slice() to extract byte field data:
BinaryReader.bytes()
slice()
return this.buf.slice(start, this.pos);
According to MDN, this creates a copy:
The slice method does not alter the original typed array, but instead returns a copy of a portion of the original typed array.
Since we do not need a copy, it should be possible to replace this with:
return new Uint8Array(this.buf.buffer, this.buf.byteOffset + start, len);
Which will not allocate additional memory and does not require a copy.
The text was updated successfully, but these errors were encountered:
58b774b
We are now using subarray() (equivalent to creating a Uint8Array like above).
subarray()
Sorry, something went wrong.
Add force_exclude_all_options plugin option
force_exclude_all_options
ab9d65e
Closes #148
No branches or pull requests
BinaryReader.bytes()
usesslice()
to extract byte field data:According to MDN, this creates a copy:
Since we do not need a copy, it should be possible to replace this with:
Which will not allocate additional memory and does not require a copy.
The text was updated successfully, but these errors were encountered: