small optimization when sorting based on count and same count entries requires sorting based on term
This commit is contained in:
parent
ee015f5829
commit
1c555679a1
|
@ -64,7 +64,7 @@ public interface TermsFacet extends Facet, Iterable<TermsFacet.Entry> {
|
|||
@Override public int compare(Entry o1, Entry o2) {
|
||||
int i = o2.count() - o1.count();
|
||||
if (i == 0) {
|
||||
i = o2.term().compareTo(o1.term());
|
||||
i = o2.compareTo(o1);
|
||||
if (i == 0) {
|
||||
i = System.identityHashCode(o2) - System.identityHashCode(o1);
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public interface TermsStatsFacet extends Facet, Iterable<TermsStatsFacet.Entry>
|
|||
}
|
||||
int i = (o2.count() < o1.count() ? -1 : (o1.count() == o2.count() ? 0 : 1));
|
||||
if (i == 0) {
|
||||
i = o2.term().compareTo(o1.term());
|
||||
i = o2.compareTo(o1);
|
||||
if (i == 0) {
|
||||
i = System.identityHashCode(o2) - System.identityHashCode(o1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue