Skip to content

buffer: remove MAX_SAFE_INTEGER check on length

Rodrigo Muino Tomonari requested to merge github/fork/Trott/is-it-safe into master

MAX_SAFE_INTEGER is millions of times larger than the largest buffer allowed in Node.js. There is no need to squash the length down to MAX_SAFE_INTEGER. Removing that check results in a small but statistically significant increase for Buffer.from() operating on ArrayBuffers in some situations.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

buffer

Merge request reports

Loading