Skip to content
This repository was archived by the owner on Nov 12, 2019. It is now read-only.

Commit 54f0a24

Browse files
author
shotwave
committed
redundant sorting remooved
1 parent cf81616 commit 54f0a24

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/difflib/DiffUtils.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
import difflib.myers.MyersDiff;
1919

2020
import java.util.ArrayList;
21-
import java.util.Collections;
22-
import java.util.Comparator;
2321
import java.util.List;
2422
import java.util.regex.Matcher;
2523
import java.util.regex.Pattern;
@@ -189,13 +187,7 @@ public static List<String> generateUnifiedDiff(String original, String revised,
189187
ret.add("+++ " + revised);
190188

191189
if (!patch.getDeltas().isEmpty()) {
192-
// Hmm, I thought the Deltas were sorted already... turns out they're not.
193190
List<Delta> patchDeltas = new ArrayList<Delta>(patch.getDeltas());
194-
Collections.sort(patchDeltas, new Comparator<Delta>() {
195-
public int compare(Delta a, Delta b) {
196-
return new Integer(a.getOriginal().getPosition()).compareTo(b.getOriginal().getPosition());
197-
}
198-
});
199191

200192
// code outside the if block also works for single-delta issues.
201193
List<Delta> deltas = new ArrayList<Delta>(); // current list of Delta's to process

0 commit comments

Comments
 (0)