mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
2d26208a55
commit
06d8db19cb
2 changed files with 9 additions and 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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue