montagejs/montage — pull request #1390 by aadsm (2014-01-07 02:56:44+00:00)
Title: Generalize repetition optimization for the flow

Instead of just reusing the iterations directly when plus.length ===
minus.length, apply the same strategy whenever we need to add and remove
iterations. We are always able to do this with min(plus.length,
minus.length) iterations.

This change reduces the number of bindings being fired because we only set the `iteration.content` once. So its benefits depends on the number of bindings and the side effects caused by them.