django/django — pull request #3540 by Tilka (2014-11-15 16:42:52+00:00)
Title: RFC: optimize migration optimizer loop

Previously, the optimizer started over from the beginning whenever it optimized something. This can be optimized by skipping all the unchanged operations before the modified one.
Example:

A, B, C, D

Assume C and D have been merged into E:

A, B, E

Then it's not necessary to try to reduce A and B again, instead one can start with A and E.

**The RFC part:** My implementation doesn't seem to be fully correct. Without the additional reduce method, a test fails.