diff options
author | Rich Trott <rtrott@gmail.com> | 2019-02-04 22:06:08 -0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-02-06 22:18:31 -0800 |
commit | 29e74d4952b772f7f1bf51e1a8f1665bbbde39d1 (patch) | |
tree | 211a7131ae8f0fa7d8d5f65422cd53ad0741de33 /benchmark/crypto | |
parent | d310d8df62f9c05d07e68c4177f225e9dda72271 (diff) | |
download | android-node-v8-29e74d4952b772f7f1bf51e1a8f1665bbbde39d1.tar.gz android-node-v8-29e74d4952b772f7f1bf51e1a8f1665bbbde39d1.tar.bz2 android-node-v8-29e74d4952b772f7f1bf51e1a8f1665bbbde39d1.zip |
benchmark: refactor for consistent style
Code in benchmark directory sometimes uses `function () {}` for
anonymous callbacks and sometimes uses `() => {}`. Multi-line arrays
sometimes have a trailing comma and sometimes do not. Update to always
use arrow functions for anonymous callbacks and trailing commas for
multiline arrays.
PR-URL: https://github.com/nodejs/node/pull/25944
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'benchmark/crypto')
-rw-r--r-- | benchmark/crypto/cipher-stream.js | 4 | ||||
-rw-r--r-- | benchmark/crypto/rsa-encrypt-decrypt-throughput.js | 2 | ||||
-rw-r--r-- | benchmark/crypto/rsa-sign-verify-throughput.js | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/benchmark/crypto/cipher-stream.js b/benchmark/crypto/cipher-stream.js index c9989d32dc..584039a1e5 100644 --- a/benchmark/crypto/cipher-stream.js +++ b/benchmark/crypto/cipher-stream.js @@ -66,11 +66,11 @@ function main({ api, cipher, type, len, writes }) { function streamWrite(alice, bob, message, encoding, writes) { var written = 0; - bob.on('data', function(c) { + bob.on('data', (c) => { written += c.length; }); - bob.on('end', function() { + bob.on('end', () => { // Gbits const bits = written * 8; const gbits = bits / (1024 * 1024 * 1024); diff --git a/benchmark/crypto/rsa-encrypt-decrypt-throughput.js b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js index 40b69c31f9..1295ac8506 100644 --- a/benchmark/crypto/rsa-encrypt-decrypt-throughput.js +++ b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js @@ -9,7 +9,7 @@ const keylen_list = ['1024', '2048', '4096']; const RSA_PublicPem = {}; const RSA_PrivatePem = {}; -keylen_list.forEach(function(key) { +keylen_list.forEach((key) => { RSA_PublicPem[key] = fs.readFileSync(`${fixtures_keydir}/rsa_public_${key}.pem`); RSA_PrivatePem[key] = diff --git a/benchmark/crypto/rsa-sign-verify-throughput.js b/benchmark/crypto/rsa-sign-verify-throughput.js index 3a0373b57d..4ea39d1eb6 100644 --- a/benchmark/crypto/rsa-sign-verify-throughput.js +++ b/benchmark/crypto/rsa-sign-verify-throughput.js @@ -9,7 +9,7 @@ const keylen_list = ['1024', '2048']; const RSA_PublicPem = {}; const RSA_PrivatePem = {}; -keylen_list.forEach(function(key) { +keylen_list.forEach((key) => { RSA_PublicPem[key] = fs.readFileSync(`${fixtures_keydir}/rsa_public_${key}.pem`); RSA_PrivatePem[key] = |