Dictionaries.jl icon indicating copy to clipboard operation
Dictionaries.jl copied to clipboard

Reuse deleted places in value vector

Open mschauer opened this issue 3 years ago • 2 comments

I was just reading along and was curious if it would make sense to reuse the position in the value vector (because indices are unique) if it corresponds to a deleted index.

https://github.com/andyferris/Dictionaries.jl/blob/69183615f4322acb38ee0138aa5aa9ce2730df77/src/Indices.jl#L391

mschauer avatar Aug 19 '21 17:08 mschauer

Filling holes (except any trailing elements) would mean we violate the insertion ordering. If we knew a hole came after every non-hole (e.g. it is the last index) we could use that index, which might work well for stack-like containers?

andyferris avatar Aug 19 '21 23:08 andyferris

Ah that’s where the order comes in, thanks. But the stack like hash table: I think a symbol table with scope context has this behavior

mschauer avatar Aug 20 '21 07:08 mschauer