ruby-changes:51254
From: nobu <ko1@a...>
Date: Fri, 18 May 2018 09:40:12 +0900 (JST)
Subject: [ruby-changes:51254] nobu:r63460 (trunk): tool: fixed shadowing variables
nobu 2018-05-18 09:40:06 +0900 (Fri, 18 May 2018) New Revision: 63460 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63460 Log: tool: fixed shadowing variables Modified files: trunk/tool/checksum.rb trunk/tool/rbinstall.rb trunk/tool/transcode-tblgen.rb Index: tool/transcode-tblgen.rb =================================================================== --- tool/transcode-tblgen.rb (revision 63459) +++ tool/transcode-tblgen.rb (revision 63460) @@ -145,7 +145,7 @@ class ActionMap https://github.com/ruby/ruby/blob/trunk/tool/transcode-tblgen.rb#L145 else b = $1.to_i(16) e = $2.to_i(16) - b.upto(e) {|c| set[c] = true } + b.upto(e) {|_| set[_] = true } end } i = nil @@ -297,10 +297,10 @@ class ActionMap https://github.com/ruby/ruby/blob/trunk/tool/transcode-tblgen.rb#L297 raise ArgumentError, "ambiguous pattern: #{prefix}" if min.length != prefix.length h[action] = true end - region_rects.each {|min, max, action| + for min, _, action in region_rects raise ArgumentError, "ambiguous pattern: #{prefix}" if !min.empty? h[action] = true - } + end tree = Action.new(block.call(prefix, h.keys)) h.clear else Index: tool/rbinstall.rb =================================================================== --- tool/rbinstall.rb (revision 63459) +++ tool/rbinstall.rb (revision 63460) @@ -590,7 +590,7 @@ install?(:local, :comm, :man) do https://github.com/ruby/ruby/blob/trunk/tool/rbinstall.rb#L590 STDIN.reopen(f) begin destfile << suffix - IO.popen(compress) {|f| f.read} + IO.popen(compress, &:read) ensure STDIN.reopen(stdin) stdin.close Index: tool/checksum.rb =================================================================== --- tool/checksum.rb (revision 63459) +++ tool/checksum.rb (revision 63460) @@ -67,6 +67,6 @@ class Checksum https://github.com/ruby/ruby/blob/trunk/tool/checksum.rb#L67 def self.update(argv) k = new(VPath.new) k.source, k.target, *argv = k.def_options.parse(*argv) - k.update {|k| yield(k, *argv)} + k.update {|_| yield(_, *argv)} end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/