diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-31 08:26:30 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-31 08:26:30 +0000 |
commit | e82df08b9f72a0e003f3a69fd4bc016a0ecad19f (patch) | |
tree | 3ba5fc8079cec173fd6b7e178885792fc97cc738 | |
parent | e6ff652ce809e074f237e17bdcc44f95b0bf8c8f (diff) | |
download | ruby-e82df08b9f72a0e003f3a69fd4bc016a0ecad19f.tar.gz |
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
-rw-r--r-- | lib/optparse.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb index 5a3ea4e2dd..13d4591c07 100644 --- a/lib/optparse.rb +++ b/lib/optparse.rb @@ -1547,7 +1547,8 @@ XXX # short option 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 sw, = search(:short, opt) unless sw |