From 12c4c7da1a53d2bc44416cc21bafd5d92631eb3c Mon Sep 17 00:00:00 2001 From: Alex Herbert Date: Mon, 25 Nov 2024 13:38:16 +0000 Subject: [PATCH] Remove mid constant --- .../src/main/java/uk/ac/sussex/gdsc/core/utils/LocalList.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gdsc-core/src/main/java/uk/ac/sussex/gdsc/core/utils/LocalList.java b/gdsc-core/src/main/java/uk/ac/sussex/gdsc/core/utils/LocalList.java index 708b7fa7..019deeb7 100644 --- a/gdsc-core/src/main/java/uk/ac/sussex/gdsc/core/utils/LocalList.java +++ b/gdsc-core/src/main/java/uk/ac/sussex/gdsc/core/utils/LocalList.java @@ -1233,8 +1233,7 @@ public void sort(Comparator c) { * Reverse the list contents. */ public void reverse() { - final int mid = size >> 1; - for (int left = 0, right = size - 1; left < mid; left++, right--) { + for (int left = 0, right = size - 1; left < right; left++, right--) { // swap the values at the left and right indices final Object temp = data[left]; data[left] = data[right];