mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-10 04:26:27 +08:00
statistics optimization
This commit is contained in:
@ -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 + "");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user