optparse.rb: no duplicate strings
* lib/optparse.rb (OptionParser#parse_in_order): get rid of making duplicate strings; $1 and others make a new string each times. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e6ff652ce8
commit
e82df08b9f
@ -1547,7 +1547,8 @@ XXX
|
|||||||
|
|
||||||
# short option
|
# short option
|
||||||
when /\A-(.)((=).*|.+)?/m
|
when /\A-(.)((=).*|.+)?/m
|
||||||
opt, has_arg, eq, val, rest = $1, $3, $3, $2, $2
|
eq, rest, opt = $3, $2, $1
|
||||||
|
has_arg, val = eq, rest
|
||||||
begin
|
begin
|
||||||
sw, = search(:short, opt)
|
sw, = search(:short, opt)
|
||||||
unless sw
|
unless sw
|
||||||
|
Loading…
x
Reference in New Issue
Block a user