-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
The length of a node needs to be recalculated after the second condition in the insert function, at https://github.com/component/rope/blob/master/index.js#L136.
I think it should be this instead:
var leftLength = this._left.length;
if (position < leftLength) {
this._left.insert(position, value);
} else {
this._right.insert(position - leftLength, value);
}
this.length = this._left.length + this._right.length;akcode101, qdirks and return-z
Metadata
Metadata
Assignees
Labels
No labels