Permalink
Browse files

Fixed warning about shadowing outer local variable.

This commit removes below warnings.

* "warning: shadowing outer local variable"
  • Loading branch information...
1 parent f6734b0 commit f70b46b8910693142772b65aac1b0864022a7f7e @kachick kachick committed Jan 23, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/addressable/uri.rb
View
8 lib/addressable/uri.rb
@@ -367,8 +367,8 @@ def self.encode_component(component, character_class=
(sequence.unpack('C*').map { |c| "%" + ("%02x" % c).upcase }).join
end
if upcase_encoded.length > 0
- component.gsub!(/%(#{upcase_encoded.chars.map do |c|
- c.unpack('C*').map { |c| '%02x' % c }.join
+ component.gsub!(/%(#{upcase_encoded.chars.map do |char|
+ char.unpack('C*').map { |c| '%02x' % c }.join
end.join('|')})/i) { |s| s.upcase }
end
return component
@@ -497,8 +497,8 @@ def self.normalize_component(component, character_class=
leave_re = if leave_encoded.length > 0
character_class << '%'
- "|%(?!#{leave_encoded.chars.map do |c|
- seq = c.unpack('C*').map { |c| '%02x' % c }.join
+ "|%(?!#{leave_encoded.chars.map do |char|
+ seq = char.unpack('C*').map { |c| '%02x' % c }.join
[seq.upcase, seq.downcase]
end.flatten.join('|')})"
end

0 comments on commit f70b46b

Please sign in to comment.