Skip to content

Commit

Permalink
Merge pull request #521 from kboyarshinov/file_comparator_fix
Browse files Browse the repository at this point in the history
Change LastModifiedComparator implementation to be identical with Long.compare()
  • Loading branch information
william-ferguson-au committed Oct 11, 2016
2 parents c92adf3 + e090ab2 commit 01d07c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/org/acra/file/LastModifiedComparator.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
final class LastModifiedComparator implements Comparator<File> {
@Override
public int compare(@NonNull File lhs, @NonNull File rhs) {
return (int) (lhs.lastModified() - rhs.lastModified());
long l = lhs.lastModified();
long r = rhs.lastModified();
return l < r ? -1 : (l == r ? 0 : 1);
}
}

0 comments on commit 01d07c0

Please sign in to comment.