summaryrefslogtreecommitdiff
path: root/test/ruby/enc
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-20 18:27:45 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-20 18:27:45 +0000
commita8e5eaa4b9d930b257ba01d7845e868165f95fb1 (patch)
tree9bf272acf9027f46f6654c34d190431290382255 /test/ruby/enc
parent6e6a8c02aff7207745808cdaa4b12e8f1e9ace82 (diff)
Don't cache simple data to reduce memory usage
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/enc')
-rw-r--r--test/ruby/enc/test_case_comprehensive.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/ruby/enc/test_case_comprehensive.rb b/test/ruby/enc/test_case_comprehensive.rb
index f8ee0529e1..a67cb421d2 100644
--- a/test/ruby/enc/test_case_comprehensive.rb
+++ b/test/ruby/enc/test_case_comprehensive.rb
@@ -41,19 +41,19 @@ class TestComprehensiveCaseFold < Test::Unit::TestCase
def self.read_data
@@codepoints = []
- downcase = Hash.new { |h, c| h[c] = c }
- upcase = Hash.new { |h, c| h[c] = c }
- titlecase = Hash.new { |h, c| h[c] = c }
- casefold = Hash.new { |h, c| h[c] = c }
- swapcase = Hash.new { |h, c| h[c] = c }
- turkic_upcase = Hash.new { |h, c| h[c] = upcase[c] }
- turkic_downcase = Hash.new { |h, c| h[c] = downcase[c] }
- turkic_titlecase = Hash.new { |h, c| h[c] = titlecase[c] }
- turkic_swapcase = Hash.new { |h, c| h[c] = swapcase[c] }
- ascii_upcase = Hash.new { |h, c| h[c] = c =~ /\A[a-zA-Z]\z/ ? upcase[c] : c }
- ascii_downcase = Hash.new { |h, c| h[c] = c =~ /\A[a-zA-Z]\z/ ? downcase[c] : c }
- ascii_titlecase = Hash.new { |h, c| h[c] = c =~ /\A[a-zA-Z]\z/ ? titlecase[c] : c }
- ascii_swapcase = Hash.new { |h, c| h[c] = c=~/\A[a-z]\z/ ? upcase[c] : (c=~/\A[A-Z]\z/ ? downcase[c] : c) }
+ downcase = Hash.new { |h, c| c }
+ upcase = Hash.new { |h, c| c }
+ titlecase = Hash.new { |h, c| c }
+ casefold = Hash.new { |h, c| c }
+ swapcase = Hash.new { |h, c| c }
+ turkic_upcase = Hash.new { |h, c| upcase[c] }
+ turkic_downcase = Hash.new { |h, c| downcase[c] }
+ turkic_titlecase = Hash.new { |h, c| titlecase[c] }
+ turkic_swapcase = Hash.new { |h, c| swapcase[c] }
+ ascii_upcase = Hash.new { |h, c| c =~ /\A[a-zA-Z]\z/ ? upcase[c] : c }
+ ascii_downcase = Hash.new { |h, c| c =~ /\A[a-zA-Z]\z/ ? downcase[c] : c }
+ ascii_titlecase = Hash.new { |h, c| c =~ /\A[a-zA-Z]\z/ ? titlecase[c] : c }
+ ascii_swapcase = Hash.new { |h, c| c=~/\A[a-z]\z/ ? upcase[c] : (c=~/\A[A-Z]\z/ ? downcase[c] : c) }
read_data_file('UnicodeData') do |code, data|
@@codepoints << code