This is an automated email from the ASF dual-hosted git repository.

garydgregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-cli.git


The following commit(s) were added to refs/heads/master by this push:
     new 2fb8cb4e Extract into final local variable.
2fb8cb4e is described below

commit 2fb8cb4e807932f0d28a49622239489501a6d550
Author: Gary Gregory <[email protected]>
AuthorDate: Sun Jul 26 10:56:10 2026 -0400

    Extract into final local variable.
---
 src/main/java/org/apache/commons/cli/help/Util.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/commons/cli/help/Util.java 
b/src/main/java/org/apache/commons/cli/help/Util.java
index 76d584f3..921f9ad7 100644
--- a/src/main/java/org/apache/commons/cli/help/Util.java
+++ b/src/main/java/org/apache/commons/cli/help/Util.java
@@ -54,10 +54,11 @@ final class Util {
         }
         // the line ends before the max wrap pos or a new line char found
         int idx = startPos;
-        while (idx < text.length() && isWhitespace(text.charAt(idx))) {
+        final int length = text.length();
+        while (idx < length && isWhitespace(text.charAt(idx))) {
             idx++;
         }
-        return idx < text.length() ? idx : NOT_FOUND;
+        return idx < length ? idx : NOT_FOUND;
     }
 
     /**

Reply via email to