Remove trailing INSERT and DELETE from a list of diffs
(diffs)
| 107 | |
| 108 | |
| 109 | def trim(diffs): |
| 110 | """ |
| 111 | Remove trailing INSERT and DELETE from a list of diffs |
| 112 | """ |
| 113 | # FIXME: this may be best done in the main loop? |
| 114 | while diffs: |
| 115 | op, _ = diffs[-1] |
| 116 | if op in (DIFF_DELETE, DIFF_INSERT): |
| 117 | diffs.pop() |
| 118 | else: |
| 119 | break |
| 120 | return diffs |
| 121 | |
| 122 | |
| 123 | class Differ(object): |
no test coverage detected