replace usage of Buffer.from with Buffer.alloc

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

View File

@ -44,10 +44,10 @@ var serviceProto = grpc.loadPackageDefinition(protoPackage).grpc.testing;
/**
* 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;
}