ericdrowell/KineticJS — pull request #803 by Moeriki (2014-02-10 20:50:31+00:00)
Title: Overhead with childIndices

I've noticed a small overhead issue when removing many nodes subsequently. Either manually in the application logic, or with Kinetic.Container.removeChildren().

I improved Kinetic.Container.prototype._setChildIndices() by accepting an optional startIndex parameter and made smart use of this throughout its usage.

Additionally I reversed the destroy/remove logic. When starting at the beginning all child indices are being updated on each iteration, which is unneeded as they'll all be removed in the end. By starting at the end (in combination with the new startIndex parameter) this small overhead is fixed.