Skip to content

Commit

Permalink
use alloc if present
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh authored Mar 26, 2018
1 parent 4dcd30f commit 01faf17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var hasFullSupport = (function () {
return false
}

var buf = new Buffer(4)
var buf = Buffer.alloc ? Buffer.alloc(4) : new Buffer(4)

buf.fill('ab', 'ucs2')

Expand Down

0 comments on commit 01faf17

Please sign in to comment.