Skip to content

Commit

Permalink
8321637: Simplify if statement in ArraysSupport::hugeLength
Browse files Browse the repository at this point in the history
  • Loading branch information
johnshajiang committed Dec 9, 2023
1 parent ce10844 commit 4e874d3
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -751,10 +751,8 @@ private static int hugeLength(int oldLength, int minGrowth) {
if (minLength < 0) { // overflow
throw new OutOfMemoryError(
"Required array length " + oldLength + " + " + minGrowth + " is too large");
} else if (minLength <= SOFT_MAX_ARRAY_LENGTH) {
return SOFT_MAX_ARRAY_LENGTH;
} else {
return minLength;
} else {
return Math.max(minLength, SOFT_MAX_ARRAY_LENGTH);
}
}

Expand Down

0 comments on commit 4e874d3

Please sign in to comment.