mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* tool/transcode-tblgen.rb: reuse hash object.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
49d993729f
commit
8e63c340b9
2 changed files with 7 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue