diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-09 16:59:53 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-09 16:59:53 +0000 |
| commit | 03c0013466deabcc1053a2c23010fd7ac60bb787 (patch) | |
| tree | 8b59cbd5d0da10c1ec45ca7cffa4c7d54002840b | |
| parent | 297d87e979d9548512935456433a899bfab08a19 (diff) | |
| download | ruby-03c0013466deabcc1053a2c23010fd7ac60bb787.tar.gz ruby-03c0013466deabcc1053a2c23010fd7ac60bb787.tar.xz ruby-03c0013466deabcc1053a2c23010fd7ac60bb787.zip | |
* tool/transcode-tblgen.rb (StrSet#hash): cache hash value.
(ActionMap#hash): ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | tool/transcode-tblgen.rb | 6 |
2 files changed, 9 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Wed Sep 10 01:57:23 2008 Tanaka Akira <akr@fsij.org> + + * tool/transcode-tblgen.rb (StrSet#hash): cache hash value. + (ActionMap#hash): ditto. + Wed Sep 10 01:26:01 2008 Tanaka Akira <akr@fsij.org> * include/ruby/encoding.h (econv_after_output): renamed from diff --git a/tool/transcode-tblgen.rb b/tool/transcode-tblgen.rb index 5395460ee..05ee5d314 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) |
