diff options
author | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2017-06-08 18:30:57 +0300 |
---|---|---|
committer | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2017-06-12 12:10:22 +0300 |
commit | 8beff648518aa8e846221d03e31bea5f78f62010 (patch) | |
tree | 7ad9a821d4ef0e70647eaf77e5cd7d18b9a7beea /benchmark/crypto/cipher-stream.js | |
parent | a2ed3a9c88c722a4ebbcdb5e6ffb59447d939507 (diff) | |
download | android-node-v8-8beff648518aa8e846221d03e31bea5f78f62010.tar.gz android-node-v8-8beff648518aa8e846221d03e31bea5f78f62010.tar.bz2 android-node-v8-8beff648518aa8e846221d03e31bea5f78f62010.zip |
benchmark: fix some RegExp nits
* Take RegExp creation out of cycle.
* use test(), not match() in boolean context.
PR-URL: https://github.com/nodejs/node/pull/13551
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'benchmark/crypto/cipher-stream.js')
-rw-r--r-- | benchmark/crypto/cipher-stream.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/benchmark/crypto/cipher-stream.js b/benchmark/crypto/cipher-stream.js index 90bf548c76..9fd88f1d86 100644 --- a/benchmark/crypto/cipher-stream.js +++ b/benchmark/crypto/cipher-stream.js @@ -11,7 +11,7 @@ var bench = common.createBenchmark(main, { function main(conf) { var api = conf.api; - if (api === 'stream' && process.version.match(/^v0\.[0-8]\./)) { + if (api === 'stream' && /^v0\.[0-8]\./.test(process.version)) { console.error('Crypto streams not available until v0.10'); // use the legacy, just so that we can compare them. api = 'legacy'; |