Skip to content

Commit

Permalink
Make Slot - Number comparator allow ordering (#4550)
Browse files Browse the repository at this point in the history
  • Loading branch information
TPGamesNL authored Apr 1, 2022
1 parent 949fd15 commit 5286e8c
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,14 @@ public boolean supportsOrdering() {
@Override
public Relation compare(Slot o1, Number o2) {
if (o1 instanceof SlotWithIndex) {
boolean same = ((SlotWithIndex) o1).getIndex() == o2.intValue();
if (same) // Slot has index and the index is same with number
return Relation.EQUAL;
return Relation.get(((SlotWithIndex) o1).getIndex() - o2.intValue());
}
return Relation.NOT_EQUAL;
}

@Override
public boolean supportsOrdering() {
return false;
return true;
}

});
Expand Down

0 comments on commit 5286e8c

Please sign in to comment.