Browse files

dgram: use Buffer.alloc(0) for zero-size buffers

There is no difference between alloc(0) and allocUnsafe(0), so there is
no reason to confuse anyone reading the code with an additional call to

PR-URL: #8751
Reviewed-By: Luigi Pinca <>
Reviewed-By: James M Snell <>
Reviewed-By: Colin Ihrig <>
Reviewed-By: Ilkka Myller <>
Reviewed-By: Anna Henningsen <>
  • Loading branch information...
ChALkeR authored and Fishrock123 committed Sep 23, 2016
1 parent 9b0733f commit c4d9b54f75dc8bd492354a0880714f7a8a8b4ee9
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/dgram.js
@@ -353,7 +353,7 @@ Socket.prototype.send = function(buffer,
self.bind({port: 0, exclusive: true}, null);
if (list.length === 0)
// If the socket hasn't been bound yet, push the outbound packet onto the
// send queue and send after binding is complete.

0 comments on commit c4d9b54

Please sign in to comment.