replace usage of Buffer.from with Buffer.alloc

This commit is contained in:
Shir Brass 2019-02-05 17:35:02 +02:00 committed by GitHub
parent b1609a1311
commit 90888cae88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -49,10 +49,10 @@ var ECHO_TRAILING_KEY = 'x-grpc-test-echo-trailing-bin';
/**
* Create a buffer filled with size zeroes
* @param {number} size The length of the buffer
* @return {Buffer} The Buffer.from
* @return {Buffer} The New Buffer
*/
function zeroBuffer(size) {
var zeros = Buffer.from(size);
var zeros = Buffer.alloc(size);
zeros.fill(0);
return zeros;
}