From 76cebab9a903aafe2978232229e77c5ca3b7d3f4 Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Fri, 1 Oct 2010 21:40:47 +0800 Subject: [PATCH] Avoid unnecessary construction of deep strings Especially when the -spec specifies that a string() is returned. --- src/getopt.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/getopt.erl b/src/getopt.erl index 25ceab5..f303ab0 100644 --- a/src/getopt.erl +++ b/src/getopt.erl @@ -456,10 +456,10 @@ usage_options_reverse([{Name, Short, Long, _ArgSpec, Help} | Tail], Acc) -> case Short of % Only long form. undefined -> - [$-, $-, Long]; + [$-, $- | Long]; % Both short and long form. _ -> - [$-, Short, $,, $\s, $-, $-, Long] + [$-, Short, $,, $\s, $-, $- | Long] end end, usage_options_reverse(Tail, add_option_help(Prefix, Help, Acc));