diff options
author | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2017-06-16 18:04:33 +0300 |
---|---|---|
committer | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2017-06-19 18:06:17 +0300 |
commit | b9457717cab131a0f6e58b12f4b65a7aae4ecc30 (patch) | |
tree | b77f97b05dc2da49e0f3a9ef6fe44efd420a4732 /benchmark/run.js | |
parent | bed3579dbecfba0a619674c1a3d1918f1950de1b (diff) |
benchmark: remove needless RegExp capturing
Use non-capturing grouping or remove capturing completely when:
* capturing is useless per se, e.g. in test() check;
* captured groups are not used afterwards at all;
* some of the later captured groups are not used afterwards.
PR-URL: https://github.com/nodejs/node/pull/13718
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'benchmark/run.js')
-rw-r--r-- | benchmark/run.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/benchmark/run.js b/benchmark/run.js index 3b4944caf5c..2b263a1a6cb 100644 --- a/benchmark/run.js +++ b/benchmark/run.js @@ -60,7 +60,7 @@ if (format === 'csv') { console.log(`"${data.name}", "${conf}", ${data.rate}, ${data.time}`); } else { var rate = data.rate.toString().split('.'); - rate[0] = rate[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,'); + rate[0] = rate[0].replace(/(\d)(?=(?:\d\d\d)+(?!\d))/g, '$1,'); rate = (rate[1] ? rate.join('.') : rate[0]); console.log(`${data.name} ${conf}: ${rate}`); } |