Skip to content

Commit

Permalink
MCNumbers: Minor code quality change
Browse files Browse the repository at this point in the history
  • Loading branch information
xDec0de committed Sep 1, 2023
1 parent 813352d commit 44de7cc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/me/xdec0de/mcutils/java/MCNumbers.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ public static int[] range(int from, int to) {
if (size == 0)
return new int[] {to};
final int[] res = new int[size > 0 ? size + 1 : (size * -1) + 1];
int start = from;
if (from > to)
for (int i = 0; i < res.length; i++)
res[i] = from--;
res[i] = start--;
else
for (int i = 0; i < res.length; i++)
res[i] = from++;
res[i] = start++;
return res;
}

Expand Down

0 comments on commit 44de7cc

Please sign in to comment.