Skip to content

Commit

Permalink
remove deprecated new Buffer() usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Salakar committed Feb 9, 2020
1 parent 6803cf4 commit 24824ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions benchmarks/multi_bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@ Test.prototype.print_stats = function () {
};

small_str = '1234';
small_buf = new Buffer(small_str);
small_buf = Buffer.from(small_str);
large_str = (new Array(4096 + 1).join('-'));
large_buf = new Buffer(large_str);
large_buf = Buffer.from(large_str);
very_large_str = (new Array((4 * 1024 * 1024) + 1).join('-'));
very_large_buf = new Buffer(very_large_str);
very_large_buf = Buffer.from(very_large_str);

tests.push(new Test({descr: 'PING', command: 'ping', args: []}));
tests.push(new Test({descr: 'PING', command: 'ping', args: [], batch: 50}));
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ RedisClient.prototype.internal_send_command = function (command_obj) {
// 30000 seemed to be a good value to switch to buffers after testing and checking the pros and cons
if (args[i].length > 30000) {
big_data = true;
args_copy[i] = new Buffer(args[i], 'utf8');
args_copy[i] = Buffer.from(args[i], 'utf8');
} else {
args_copy[i] = args[i];
}
Expand Down

0 comments on commit 24824ef

Please sign in to comment.