summaryrefslogtreecommitdiff
path: root/lib/cgi/util.rb
diff options
context:
space:
mode:
authorxibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-16 10:26:57 +0000
committerxibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-16 10:26:57 +0000
commit612143ddc15515e685427b23f598d285d812be35 (patch)
treee990e11e810a616d7d65fd315b0268a797753581 /lib/cgi/util.rb
parent75cbab7fe1fd820afa83d79eccafd50db68acc86 (diff)
* lib/cgi/util.rb: Constant parameter is faster and economy than
string parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/cgi/util.rb')
-rw-r--r--lib/cgi/util.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/cgi/util.rb b/lib/cgi/util.rb
index bb5df37c113..98ff4be0cab 100644
--- a/lib/cgi/util.rb
+++ b/lib/cgi/util.rb
@@ -44,7 +44,7 @@ module CGI::Util
enc = string.encoding
if [Encoding::UTF_16BE, Encoding::UTF_16LE, Encoding::UTF_32BE, Encoding::UTF_32LE].include?(enc)
return string.gsub(Regexp.new('&(apos|amp|quot|gt|lt|#[0-9]+|#x[0-9A-Fa-f]+);'.encode(enc))) do
- case $1.encode("US-ASCII")
+ case $1.encode(Encoding::US_ASCII)
when 'apos' then "'".encode(enc)
when 'amp' then '&'.encode(enc)
when 'quot' then '"'.encode(enc)