1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

remove deprecated new Buffer() usage

This commit is contained in:
Salakar
2020-02-09 03:58:55 +00:00
parent 6803cf4e8f
commit 24824efdcc
2 changed files with 4 additions and 4 deletions

View File

@@ -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}));

View File

@@ -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];
}