summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-21 08:15:16 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-21 08:15:16 +0000
commit8e63c340b91f66ac3eceb864469003d12ba6000f (patch)
tree2f7e4bc0d78b745f744287c36d239ebe33c1276b
parent49d993729fd9507b9ae950db5bfb419536846d40 (diff)
* tool/transcode-tblgen.rb: reuse hash object.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rwxr-xr-xtool/transcode-tblgen.rb5
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 46e898addc..40245a58ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Mar 21 17:14:49 2010 Tanaka Akira <akr@fsij.org>
+
+ * tool/transcode-tblgen.rb: reuse hash object.
+
Sun Mar 21 12:32:39 2010 Tanaka Akira <akr@fsij.org>
* tool/transcode-tblgen.rb (transcode_compile_tree): make
diff --git a/tool/transcode-tblgen.rb b/tool/transcode-tblgen.rb
index ba7855b71a..edc8db72a9 100755
--- a/tool/transcode-tblgen.rb
+++ b/tool/transcode-tblgen.rb
@@ -285,10 +285,11 @@ class ActionMap
ret
end
+ TMPHASH = {}
def self.expand_rec(prefix, region_rects, &block)
return region_rects if region_rects.empty? && !((s_rect = @singleton_rects.last) && s_rect[0].start_with?(prefix))
if region_rects.empty? ? s_rect[0].length == prefix.length : region_rects[0][0].empty?
- h = {}
+ h = TMPHASH
while (s_rect = @singleton_rects.last) && s_rect[0].start_with?(prefix)
min, max, action = @singleton_rects.pop
raise ArgumentError, "ambiguous pattern: #{prefix}" if min.length != prefix.length
@@ -316,7 +317,7 @@ class ActionMap
end
def self.each_firstbyte_range(prefix, region_rects)
- index_from = {}
+ index_from = TMPHASH
region_ary = []
region_rects.each {|min, max, action|