Backport 12153 to 7.x: buffer,util: refactor for performance
internal/util.js definied toInteger() and toLength() but they were only used by buffer.js. Inlining these small functions results in a small but statistically-significant performance gain.
PR-URL: https://github.com/nodejs/node/pull/12153 Reviewed-By: Joyee Cheung joyeec9h3@gmail.com Reviewed-By: Michaël Zasso targos@protonmail.com Reviewed-By: James M Snell jasnell@gmail.com
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines