Skip to content

Commit 2fb8cb4

Browse files
committed
Extract into final local variable.
1 parent 07ca2bb commit 2fb8cb4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • src/main/java/org/apache/commons/cli/help

‎src/main/java/org/apache/commons/cli/help/Util.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ static int indexOfNonWhitespace(final CharSequence text, final int startPos) {
5454
}
5555
// the line ends before the max wrap pos or a new line char found
5656
int idx = startPos;
57-
while (idx < text.length() && isWhitespace(text.charAt(idx))) {
57+
final int length = text.length();
58+
while (idx < length && isWhitespace(text.charAt(idx))) {
5859
idx++;
5960
}
60-
return idx < text.length() ? idx : NOT_FOUND;
61+
return idx < length ? idx : NOT_FOUND;
6162
}
6263

6364
/**

0 commit comments

Comments
 (0)