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

commit 234a34d61dc11a302358c92fd18ed702327c5e39
Author: Gary Gregory <[email protected]>
AuthorDate: Sat Nov 8 17:33:31 2025 -0500

    Use ternary to reduce duplication
---
 src/main/java/org/apache/commons/cli/CommandLine.java | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/commons/cli/CommandLine.java 
b/src/main/java/org/apache/commons/cli/CommandLine.java
index 67d70c77..477903e7 100644
--- a/src/main/java/org/apache/commons/cli/CommandLine.java
+++ b/src/main/java/org/apache/commons/cli/CommandLine.java
@@ -1022,11 +1022,7 @@ public class CommandLine implements Serializable {
      */
     private void processPropertiesFromValues(final Properties props, final 
List<String> values) {
         for (int i = 0; i < values.size(); i += 2) {
-            if (i + 1 < values.size()) {
-                props.put(values.get(i), values.get(i + 1));
-            } else {
-                props.put(values.get(i), "true");
-            }
+            props.put(values.get(i), i + 1 < values.size() ? values.get(i + 1) 
: "true");
         }
     }
 

Reply via email to