aboutsummaryrefslogtreecommitdiff
path: root/lib/buffer.js
diff options
context:
space:
mode:
authorNikolai Vavilov <vvnicholas@gmail.com>2017-02-16 16:55:56 +0200
committerGitHub <noreply@github.com>2017-02-16 16:55:56 +0200
commit00c86cc8e9b5172372571cc122ebeb6d5a7e5e93 (patch)
tree647429bd4077c6fe04b3c3b0a50c21e99299bed2 /lib/buffer.js
parentbd07c8fc12e88746b1da93aeecc8562faa14be2f (diff)
downloadandroid-node-v8-00c86cc8e9b5172372571cc122ebeb6d5a7e5e93.tar.gz
android-node-v8-00c86cc8e9b5172372571cc122ebeb6d5a7e5e93.tar.bz2
android-node-v8-00c86cc8e9b5172372571cc122ebeb6d5a7e5e93.zip
buffer: remove Uint8Array check
This makes write[U]Int* operations on Buffer with `noAssert=false` about 3 times faster. PR-URL: https://github.com/nodejs/node/pull/11324 Refs: https://github.com/nodejs/node/issues/11245 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'lib/buffer.js')
-rw-r--r--lib/buffer.js2
1 files changed, 0 insertions, 2 deletions
diff --git a/lib/buffer.js b/lib/buffer.js
index dbec9bd920..b6928c18f8 100644
--- a/lib/buffer.js
+++ b/lib/buffer.js
@@ -1056,8 +1056,6 @@ Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
function checkInt(buffer, value, offset, ext, max, min) {
- if (!isUint8Array(buffer))
- throw new TypeError('"buffer" argument must be a Buffer or Uint8Array');
if (value > max || value < min)
throw new TypeError('"value" argument is out of bounds');
if (offset + ext > buffer.length)