summaryrefslogtreecommitdiff
path: root/lib/buffer.js
diff options
context:
space:
mode:
authorTrevor Norris <trev.norris@gmail.com>2013-07-23 10:43:48 -0700
committerTrevor Norris <trev.norris@gmail.com>2013-07-23 10:43:48 -0700
commitd74932e51837f87ef57c44204ccab2c3c2f05fa1 (patch)
tree8642759061a2b4ee6cf541921f6ae19287309e16 /lib/buffer.js
parentd904c231b6f5c4a0fd9c086c5e0d9a67e3e62866 (diff)
downloadnode-new-d74932e51837f87ef57c44204ccab2c3c2f05fa1.tar.gz
buffer: revert length and parent check
In a rush to implement the fix 35e0d60 I overlooked the logic that causes 0-length buffer instantiation to automatically not assign the parent regardless.
Diffstat (limited to 'lib/buffer.js')
-rw-r--r--lib/buffer.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/buffer.js b/lib/buffer.js
index 2aac14caa7..17e1c6579c 100644
--- a/lib/buffer.js
+++ b/lib/buffer.js
@@ -83,12 +83,10 @@ function Buffer(subject, encoding) {
if (this.length < Buffer.poolSize / 2 && this.length > 0) {
if (this.length > poolSize - poolOffset)
createPool();
- var parent = sliceOnto(allocPool,
- this,
- poolOffset,
- poolOffset + this.length);
- if (this.length > 0)
- this.parent = parent;
+ this.parent = sliceOnto(allocPool,
+ this,
+ poolOffset,
+ poolOffset + this.length);
poolOffset += this.length;
} else {
alloc(this, this.length);