ruby-changes:22447
From: tenderlove <ko1@a...>
Date: Thu, 9 Feb 2012 03:04:05 +0900 (JST)
Subject: [ruby-changes:22447] tenderlove:r34496 (trunk): eliminate `shadowing outer local variable - name` warning.
tenderlove 2012-02-09 03:03:51 +0900 (Thu, 09 Feb 2012) New Revision: 34496 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34496 Log: eliminate `shadowing outer local variable - name` warning. Modified files: trunk/lib/rexml/parsers/baseparser.rb Index: lib/rexml/parsers/baseparser.rb =================================================================== --- lib/rexml/parsers/baseparser.rb (revision 34495) +++ lib/rexml/parsers/baseparser.rb (revision 34496) @@ -373,7 +373,7 @@ if md[4].size > 0 attrs = md[4].scan( ATTRIBUTE_PATTERN ) raise REXML::ParseException.new( "error parsing attributes: [#{attrs.join ', '}], excess = \"#$'\"", @source) if $' and $'.strip.size > 0 - attrs.each do |name, prefix, local_part, quote, value| + attrs.each do |attr_name, prefix, local_part, quote, value| if prefix == "xmlns" if local_part == "xml" if value != "http://www.w3.org/XML/1998/namespace" @@ -391,12 +391,12 @@ prefixes << prefix unless prefix == "xml" end - if attributes.has_key?(name) - msg = "Duplicate attribute #{name.inspect}" + if attributes.has_key?(attr_name) + msg = "Duplicate attribute #{attr_name.inspect}" raise REXML::ParseException.new(msg, @source, self) end - attributes[name] = value + attributes[attr_name] = value end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/