You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/02/03 14:22:09 UTC

[commons-cli] branch master updated: The maximum can be calculated using a Math.max() instead of doing it manually. (#111)

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

ggregory 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 6647dcc  The maximum can be calculated using a Math.max() instead of doing it manually. (#111)
6647dcc is described below

commit 6647dccc95f8ae3f3b5547b7d2cb2cbef6703e91
Author: Arturo Bernal <ar...@gmail.com>
AuthorDate: Fri Feb 3 15:22:03 2023 +0100

    The maximum can be calculated using a Math.max() instead of doing it manually. (#111)
---
 src/main/java/org/apache/commons/cli/HelpFormatter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/cli/HelpFormatter.java b/src/main/java/org/apache/commons/cli/HelpFormatter.java
index 911e3f8..b8ef670 100644
--- a/src/main/java/org/apache/commons/cli/HelpFormatter.java
+++ b/src/main/java/org/apache/commons/cli/HelpFormatter.java
@@ -708,7 +708,7 @@ public class HelpFormatter {
             }
 
             prefixList.add(optBuf);
-            max = optBuf.length() > max ? optBuf.length() : max;
+            max = Math.max(optBuf.length(), max);
         }
 
         int x = 0;