Skip to content

Commit

Permalink
Remove mid constant
Browse files Browse the repository at this point in the history
  • Loading branch information
aherbert committed Nov 25, 2024
1 parent e4ff9cb commit 12c4c7d
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1233,8 +1233,7 @@ public void sort(Comparator<? super E> 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];
Expand Down

0 comments on commit 12c4c7d

Please sign in to comment.