From 064a84f971ffc34dd88752c04f2dcfe0f1afcdb9 Mon Sep 17 00:00:00 2001 From: shellhub Date: Sun, 27 Oct 2019 18:04:12 +0800 Subject: [PATCH] statistics optimization --- DataStructures/Lists/SinglyLinkedList.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DataStructures/Lists/SinglyLinkedList.java b/DataStructures/Lists/SinglyLinkedList.java index a478d7a5f..04f904f92 100644 --- a/DataStructures/Lists/SinglyLinkedList.java +++ b/DataStructures/Lists/SinglyLinkedList.java @@ -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 + ""); } }