summaryrefslogtreecommitdiff
path: root/benchmark/buffers/buffer-bytelength.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2019-02-04 22:06:08 -0800
committerRich Trott <rtrott@gmail.com>2019-02-06 22:18:31 -0800
commit29e74d4952b772f7f1bf51e1a8f1665bbbde39d1 (patch)
tree211a7131ae8f0fa7d8d5f65422cd53ad0741de33 /benchmark/buffers/buffer-bytelength.js
parentd310d8df62f9c05d07e68c4177f225e9dda72271 (diff)
downloadandroid-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/buffers/buffer-bytelength.js')
-rw-r--r--benchmark/buffers/buffer-bytelength.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/benchmark/buffers/buffer-bytelength.js b/benchmark/buffers/buffer-bytelength.js
index fa8852a233..4caad30144 100644
--- a/benchmark/buffers/buffer-bytelength.js
+++ b/benchmark/buffers/buffer-bytelength.js
@@ -12,7 +12,7 @@ const chars = [
'hello brendan!!!', // 1 byte
'ΰαβγδεζηθικλμνξο', // 2 bytes
'挰挱挲挳挴挵挶挷挸挹挺挻挼挽挾挿', // 3 bytes
- '𠜎𠜱𠝹𠱓𠱸𠲖𠳏𠳕𠴕𠵼𠵿𠸎𠸏𠹷𠺝𠺢' // 4 bytes
+ '𠜎𠜱𠝹𠱓𠱸𠲖𠳏𠳕𠴕𠵼𠵿𠸎𠸏𠹷𠺝𠺢', // 4 bytes
];
function main({ n, len, encoding }) {
@@ -33,9 +33,7 @@ function main({ n, len, encoding }) {
}
// Check the result to ensure it is *properly* optimized
- results = strings.map(function(val) {
- return Buffer.byteLength(val, encoding);
- });
+ results = strings.map((val) => Buffer.byteLength(val, encoding));
}
bench.start();