Skip to content

Commit

Permalink
buffer: changed N to len and replaced all N to len
Browse files Browse the repository at this point in the history
  • Loading branch information
troy0820 authored and Trott committed Dec 23, 2016
1 parent df392f0 commit 08cdc9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-base64-decode.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, {
});

function main(conf) {
const n = +conf.len;
const n = +conf.n;
const s = 'abcd'.repeat(8 << 20);
s.match(/./); // Flatten string.
assert.strictEqual(s.length % 4, 0);
Expand Down
8 changes: 4 additions & 4 deletions benchmark/buffers/buffer-base64-encode.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ const bench = common.createBenchmark(main, {
});

function main(conf) {
const n = +conf.len;
const N = +conf.N;
const b = Buffer.allocUnsafe(N);
const n = +conf.n;
const len = +conf.len;
const b = Buffer.allocUnsafe(len);
let s = '';
let i;
for (i = 0; i < 256; ++i) s += String.fromCharCode(i);
for (i = 0; i < N; i += 256) b.write(s, i, 256, 'ascii');
for (i = 0; i < len; i += 256) b.write(s, i, 256, 'ascii');
bench.start();
for (i = 0; i < n; ++i) b.toString('base64');
bench.end(n);
Expand Down

0 comments on commit 08cdc9c

Please sign in to comment.