Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0d2b068

Browse filesBrowse files
author
shotwave
committed
further perf optimization: do not create integer objects at all
1 parent 81c71e4 commit 0d2b068
Copy full SHA for 0d2b068

File tree

1 file changed

+8
-1
lines changed
Filter options

1 file changed

+8
-1
lines changed

‎src/difflib/DeltaComparator.java

Copy file name to clipboardExpand all lines: src/difflib/DeltaComparator.java
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ private DeltaComparator() {
1414
}
1515

1616
public int compare(final Delta a, final Delta b) {
17-
return Integer.valueOf(a.getOriginal().getPosition()).compareTo(b.getOriginal().getPosition());
17+
final int posA = a.getOriginal().getPosition();
18+
final int posB = b.getOriginal().getPosition();
19+
if (posA > posB) {
20+
return 1;
21+
} else if (posA < posB) {
22+
return -1;
23+
}
24+
return 0;
1825
}
1926
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.