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.
This commit is contained in:
parent
d904c231b6
commit
d74932e518
@ -83,12 +83,10 @@ function Buffer(subject, encoding) {
|
|||||||
if (this.length < Buffer.poolSize / 2 && this.length > 0) {
|
if (this.length < Buffer.poolSize / 2 && this.length > 0) {
|
||||||
if (this.length > poolSize - poolOffset)
|
if (this.length > poolSize - poolOffset)
|
||||||
createPool();
|
createPool();
|
||||||
var parent = sliceOnto(allocPool,
|
this.parent = sliceOnto(allocPool,
|
||||||
this,
|
this,
|
||||||
poolOffset,
|
poolOffset,
|
||||||
poolOffset + this.length);
|
poolOffset + this.length);
|
||||||
if (this.length > 0)
|
|
||||||
this.parent = parent;
|
|
||||||
poolOffset += this.length;
|
poolOffset += this.length;
|
||||||
} else {
|
} else {
|
||||||
alloc(this, this.length);
|
alloc(this, this.length);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user