Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/hash.cr
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,8 @@ class Hash(K, V)
# Marks an entry in `@entries` at `index` as deleted
# *without* modifying any counters (`@size` and `@deleted_count`).
private def delete_entry(index) : Nil
set_entry(index, Entry(K, V).deleted)
# sets `Entry#@hash` to 0 and removes stale references to key and value
(@entries + index).clear
end

# Marks an entry in `@entries` at `index` as deleted
Expand Down Expand Up @@ -2154,12 +2155,6 @@ class Hash(K, V)
def initialize(@hash : UInt32, @key : K, @value : V)
end

def self.deleted
key = uninitialized K
value = uninitialized V
new(0_u32, key, value)
end

def deleted? : Bool
@hash == 0_u32
end
Expand Down