You've already forked node-redis
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:
@@ -213,11 +213,11 @@ Test.prototype.print_stats = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
small_str = '1234';
|
small_str = '1234';
|
||||||
small_buf = new Buffer(small_str);
|
small_buf = Buffer.from(small_str);
|
||||||
large_str = (new Array(4096 + 1).join('-'));
|
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_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: []}));
|
||||||
tests.push(new Test({descr: 'PING', command: 'ping', args: [], batch: 50}));
|
tests.push(new Test({descr: 'PING', command: 'ping', args: [], batch: 50}));
|
||||||
|
2
index.js
2
index.js
@@ -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
|
// 30000 seemed to be a good value to switch to buffers after testing and checking the pros and cons
|
||||||
if (args[i].length > 30000) {
|
if (args[i].length > 30000) {
|
||||||
big_data = true;
|
big_data = true;
|
||||||
args_copy[i] = new Buffer(args[i], 'utf8');
|
args_copy[i] = Buffer.from(args[i], 'utf8');
|
||||||
} else {
|
} else {
|
||||||
args_copy[i] = args[i];
|
args_copy[i] = args[i];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user