Stop looking for remove line matches in move detection once one is found.
Review Request #9690 — Created Feb. 21, 2018 and submitted — Latest diff uploaded
Move detection attempts to locate a matching remove line for any insert
line, which it then uses to update any move line range. However, it
didn't stop once a match was found, and would attempt to update or
replace the range with any and all future matched remove lines, causing
ranges to be offset or outright broken.This turned out to be a simple fix. We just need to break out of the
loop when we find a match.
Tested with a broken diff I had. Saw that the ranges were correct after
this fix. Debug output confirmed it was no longer attempting other ranges.Unit tests pass.