summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-09 16:59:53 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-09 16:59:53 +0000
commit06d8db19cba0fb26f54d28b97e22537b8483ce9b (patch)
tree8b59cbd5d0da10c1ec45ca7cffa4c7d54002840b /tool
parent2d26208a55df9f55268bdbd80f47a365e1f1155c (diff)
* tool/transcode-tblgen.rb (StrSet#hash): cache hash value.
(ActionMap#hash): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rw-r--r--tool/transcode-tblgen.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/tool/transcode-tblgen.rb b/tool/transcode-tblgen.rb
index 5395460ee52..05ee5d314e8 100644
--- a/tool/transcode-tblgen.rb
+++ b/tool/transcode-tblgen.rb
@@ -62,7 +62,8 @@ class StrSet
end
def hash
- @pat.hash
+ return @hash if defined? @hash
+ @hash = @pat.hash
end
def eql?(other)
@@ -196,11 +197,12 @@ class ActionMap
end
def hash
+ return @hash if defined? @hash
hash = 0
@map.each {|k,v|
hash ^= k.hash ^ v.hash
}
- hash
+ @hash = hash
end
def eql?(other)