case-folding.rb: perfect hash for case unfolding3

* enc/unicode/case-folding.rb (lookup_hash): make perfect hash to
  lookup case unfolding table 3.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-05-30 23:58:24 +00:00
parent 8f59867651
commit 7e67b39679
4 changed files with 110 additions and 51 deletions

View file

@ -163,11 +163,8 @@ class CaseFolding
# CaseUnfold_13
name = "CaseUnfold_13"
print_table(dest, name, name=>unfold[2])
# table sizes
unfold3_table_size = unfold[2].size
dest.printf("#define UNFOLD3_TABLE_SIZE\t%d\n", (unfold3_table_size * 1.7))
data = print_table(dest, name, name=>unfold[2])
dest.print lookup_hash(name, "CodePointList2", data)
end
def self.load(*args)