[前][次][番号順一覧][スレッド一覧]

ruby-changes:43153

From: nobu <ko1@a...>
Date: Tue, 31 May 2016 17:26:37 +0900 (JST)
Subject: [ruby-changes:43153] nobu:r55227 (trunk): optparse.rb: no duplicate strings

nobu	2016-05-31 17:26:30 +0900 (Tue, 31 May 2016)

  New Revision: 55227

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55227

  Log:
    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.

  Modified files:
    trunk/lib/optparse.rb
Index: lib/optparse.rb
===================================================================
--- lib/optparse.rb	(revision 55226)
+++ lib/optparse.rb	(revision 55227)
@@ -1547,7 +1547,8 @@ XXX https://github.com/ruby/ruby/blob/trunk/lib/optparse.rb#L1547
 
         # 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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]