Added very small optimization to exact rename detection

Optimized a small loop in findExactRenames. The loop would go through
all the items in a list of DiffEntries even after it already found
what it was looking for. I made it break out of the loop as soon as
a good match was found.

Change-Id: I28741e0c49ce52d8008930a87cd1db7037700a61
This commit is contained in:
Jeff Schumacher 2010-07-12 11:48:56 -07:00
parent a20e6f6fec
commit bc08fafb41
1 changed files with 3 additions and 1 deletions

View File

@ -351,8 +351,10 @@ private void findExactRenames(ProgressMonitor pm) {
List<DiffEntry> list = (List<DiffEntry>) del;
DiffEntry best = null;
for (DiffEntry e : list) {
if (best == null && sameType(e.oldMode, dst.newMode))
if (sameType(e.oldMode, dst.newMode)) {
best = e;
break;
}
}
if (best != null) {
if (best.changeType == ChangeType.DELETE) {