Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Zouxxyy committed Feb 2, 2024
1 parent a41e5e0 commit b139bc7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ public static Integer min(Integer v1, Integer v2) {
}

/** Safely increments the given int value by one, ensuring that no overflow occurs. */
public static int incrementSafely(int value) {
if (value < Integer.MAX_VALUE) {
return value + 1;
public static int incrementSafely(int a) {
if (a == Integer.MAX_VALUE) {
return a;
}
return value;
return a + 1;
}
}

0 comments on commit b139bc7

Please sign in to comment.