Browse files

Fix failing specs for keys with private hash method

  • Loading branch information...
1 parent 4822048 commit d20feaab1d04488fa19179cc9d009fba93a1dd35 @brainopia brainopia committed Feb 24, 2013
Showing with 6 additions and 8 deletions.
  1. +3 −4 kernel/common/hash18.rb
  2. +3 −4 kernel/common/hash19.rb
View
7 kernel/common/hash18.rb
@@ -67,7 +67,7 @@ def []=(key, value)
redistribute @entries if @size > @max_entries
- key_hash = key.hash
+ key_hash = Rubinius.privately { key.hash }
index = key_hash & @mask
item = @entries[index]
@@ -116,8 +116,7 @@ def default_proc
def delete(key)
Rubinius.check_frozen
-
- key_hash = key.hash
+ key_hash = Rubinius.privately { key.hash }
ents = @entries
@@ -201,7 +200,7 @@ def fetch(key, default=undefined)
# Searches for an item matching +key+. Returns the item
# if found. Otherwise returns +nil+.
def find_item(key)
- key_hash = key.hash
+ key_hash = Rubinius.privately { key.hash }
item = @entries[key_index(key_hash)]
while item
View
7 kernel/common/hash19.rb
@@ -122,7 +122,7 @@ def []=(key, value)
redistribute @entries if @size > @max_entries
- key_hash = key.hash
+ key_hash = Rubinius.privately { key.hash }
index = key_hash & @mask
item = @entries[index]
@@ -198,8 +198,7 @@ def default_proc=(prc)
def delete(key)
Rubinius.check_frozen
-
- key_hash = key.hash
+ key_hash = Rubinius.privately { key.hash }
index = key_index key_hash
if item = @entries[index]
@@ -262,7 +261,7 @@ def fetch(key, default=undefined)
# Searches for an item matching +key+. Returns the item
# if found. Otherwise returns +nil+.
def find_item(key)
- key_hash = key.hash
+ key_hash = Rubinius.privately { key.hash }
item = @entries[key_index(key_hash)]
while item

0 comments on commit d20feaa

Please sign in to comment.