statistics optimization

This commit is contained in:
shellhub
2019-10-27 18:04:12 +08:00
parent 87fcd2c8a4
commit 064a84f971

View File

@ -106,7 +106,7 @@ public class SinglyLinkedList {
* @throws IndexOutOfBoundsException if {@code position} not in range {@code low} to {@code high}
*/
public void checkBounds(int position, int low, int high) {
if (position < low || position > high) {
if (position > high || position < low) {
throw new IndexOutOfBoundsException(position + "");
}
}