diff options
author | Rich Trott <rtrott@gmail.com> | 2016-08-06 23:01:30 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2016-08-10 00:40:01 +0300 |
commit | ae25ed3ccd8e5be2eb172af330f037fc06b4e6c9 (patch) | |
tree | 401bd33a2d6bf3b65371d19cb83a16e7873ac342 /benchmark | |
parent | b7a8a691b4c6ff0f89b5d8dba3184eaef0efc898 (diff) |
benchmark: favor === over ==
Refs: https://github.com/nodejs/node/pull/7961#discussion_r73788501
PR-URL: https://github.com/nodejs/node/pull/8000
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/buffers/buffer-bytelength.js | 2 | ||||
-rw-r--r-- | benchmark/crypto/cipher-stream.js | 2 | ||||
-rw-r--r-- | benchmark/dgram/array-vs-concat.js | 4 | ||||
-rw-r--r-- | benchmark/dgram/multi-buffer.js | 2 | ||||
-rw-r--r-- | benchmark/dgram/offset-length.js | 2 | ||||
-rw-r--r-- | benchmark/dgram/single-buffer.js | 2 | ||||
-rw-r--r-- | benchmark/http/_http_simple.js | 12 |
7 files changed, 13 insertions, 13 deletions
diff --git a/benchmark/buffers/buffer-bytelength.js b/benchmark/buffers/buffer-bytelength.js index 273115b3def..f52cbc2c6ba 100644 --- a/benchmark/buffers/buffer-bytelength.js +++ b/benchmark/buffers/buffer-bytelength.js @@ -50,7 +50,7 @@ function main(conf) { } function buildString(str, times) { - if (times == 1) return str; + if (times === 1) return str; return str + buildString(str, times - 1); } diff --git a/benchmark/crypto/cipher-stream.js b/benchmark/crypto/cipher-stream.js index b8e1622bf9f..11e2c38c0bd 100644 --- a/benchmark/crypto/cipher-stream.js +++ b/benchmark/crypto/cipher-stream.js @@ -31,7 +31,7 @@ function main(conf) { var bob_secret = bob.computeSecret(alice.getPublicKey(), pubEnc, 'hex'); // alice_secret and bob_secret should be the same - assert(alice_secret == bob_secret); + assert(alice_secret === bob_secret); var alice_cipher = crypto.createCipher(conf.cipher, alice_secret); var bob_cipher = crypto.createDecipher(conf.cipher, bob_secret); diff --git a/benchmark/dgram/array-vs-concat.js b/benchmark/dgram/array-vs-concat.js index 1f07a504239..8b1d34d0e74 100644 --- a/benchmark/dgram/array-vs-concat.js +++ b/benchmark/dgram/array-vs-concat.js @@ -46,14 +46,14 @@ function server() { var onsend = type === 'concat' ? onsendConcat : onsendMulti; function onsendConcat() { - if (sent++ % num == 0) + if (sent++ % num === 0) for (var i = 0; i < num; i++) { socket.send(Buffer.concat(chunk), PORT, '127.0.0.1', onsend); } } function onsendMulti() { - if (sent++ % num == 0) + if (sent++ % num === 0) for (var i = 0; i < num; i++) { socket.send(chunk, PORT, '127.0.0.1', onsend); } diff --git a/benchmark/dgram/multi-buffer.js b/benchmark/dgram/multi-buffer.js index 85e9561de8c..3277547119c 100644 --- a/benchmark/dgram/multi-buffer.js +++ b/benchmark/dgram/multi-buffer.js @@ -45,7 +45,7 @@ function server() { var socket = dgram.createSocket('udp4'); function onsend() { - if (sent++ % num == 0) + if (sent++ % num === 0) for (var i = 0; i < num; i++) socket.send(chunk, PORT, '127.0.0.1', onsend); } diff --git a/benchmark/dgram/offset-length.js b/benchmark/dgram/offset-length.js index ce9f4b025ad..5b7762b21e7 100644 --- a/benchmark/dgram/offset-length.js +++ b/benchmark/dgram/offset-length.js @@ -37,7 +37,7 @@ function server() { var socket = dgram.createSocket('udp4'); function onsend() { - if (sent++ % num == 0) + if (sent++ % num === 0) for (var i = 0; i < num; i++) socket.send(chunk, 0, chunk.length, PORT, '127.0.0.1', onsend); } diff --git a/benchmark/dgram/single-buffer.js b/benchmark/dgram/single-buffer.js index 4793f65eeab..e01b60b4297 100644 --- a/benchmark/dgram/single-buffer.js +++ b/benchmark/dgram/single-buffer.js @@ -37,7 +37,7 @@ function server() { var socket = dgram.createSocket('udp4'); function onsend() { - if (sent++ % num == 0) + if (sent++ % num === 0) for (var i = 0; i < num; i++) socket.send(chunk, PORT, '127.0.0.1', onsend); } diff --git a/benchmark/http/_http_simple.js b/benchmark/http/_http_simple.js index 7e2eed53a1a..1c965b21c15 100644 --- a/benchmark/http/_http_simple.js +++ b/benchmark/http/_http_simple.js @@ -37,7 +37,7 @@ var server = module.exports = http.createServer(function(req, res) { var status = 200; var n, i; - if (command == 'bytes') { + if (command === 'bytes') { n = ~~arg; if (n <= 0) throw new Error('bytes called with n <= 0'); @@ -46,7 +46,7 @@ var server = module.exports = http.createServer(function(req, res) { } body = storedBytes[n]; - } else if (command == 'buffer') { + } else if (command === 'buffer') { n = ~~arg; if (n <= 0) throw new Error('buffer called with n <= 0'); @@ -58,7 +58,7 @@ var server = module.exports = http.createServer(function(req, res) { } body = storedBuffer[n]; - } else if (command == 'unicode') { + } else if (command === 'unicode') { n = ~~arg; if (n <= 0) throw new Error('unicode called with n <= 0'); @@ -67,14 +67,14 @@ var server = module.exports = http.createServer(function(req, res) { } body = storedUnicode[n]; - } else if (command == 'quit') { + } else if (command === 'quit') { res.connection.server.close(); body = 'quitting'; - } else if (command == 'fixed') { + } else if (command === 'fixed') { body = fixed; - } else if (command == 'echo') { + } else if (command === 'echo') { res.writeHead(200, { 'Content-Type': 'text/plain', 'Transfer-Encoding': 'chunked' }); req.pipe(res); |