Browse Source

Fast Buffer safe constructor

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
2dda6be799
  1. 4
      lib/buffer.js

4
lib/buffer.js

@ -91,6 +91,10 @@ function allocPool () {
function Buffer (subject, encoding, legacy, slice_legacy) { function Buffer (subject, encoding, legacy, slice_legacy) {
if (!(this instanceof Buffer)) {
return new Buffer(subject, encoding, legacy, slice_legacy);
}
var length, type; var length, type;
// Are we slicing? // Are we slicing?

Loading…
Cancel
Save