Stop looking for remove line matches in move detection once one is found.

Review Request #9690 — Created Feb. 21, 2018 and submitted

Information

Review Board
release-3.0.x
9956c8e...

Reviewers

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.

brennie
  1. Ship It!
  2. 
      
chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (406f9a6)
Loading...