From d16dfa2c8a24f8fe46398a7104f4b57dd9f0c1b1 Mon Sep 17 00:00:00 2001 From: Ferry Huberts Date: Fri, 8 Apr 2016 12:48:39 +0200 Subject: [PATCH] Minor performance optimisation See http://shipilev.net/blog/2016/arrays-wisdom-ancients/ Signed-off-by: Ferry Huberts --- args4j/src/org/kohsuke/args4j/CmdLineParser.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/args4j/src/org/kohsuke/args4j/CmdLineParser.java b/args4j/src/org/kohsuke/args4j/CmdLineParser.java index f3a48947..bb79eb7d 100644 --- a/args4j/src/org/kohsuke/args4j/CmdLineParser.java +++ b/args4j/src/org/kohsuke/args4j/CmdLineParser.java @@ -456,7 +456,7 @@ private String getOptionName() { * Same as {@link #parseArgument(String[])} */ public void parseArgument(Collection args) throws CmdLineException { - parseArgument(args.toArray(new String[args.size()])); + parseArgument(args.toArray(new String[0])); } /** @@ -561,7 +561,7 @@ private String[] expandAtFiles(String args[]) throws CmdLineException { result.add(arg); } } - return result.toArray(new String[result.size()]); + return result.toArray(new String[0]); } /**