Skip to content

Comment on Redis re-implemented in Rustparent

Comments

I'm surprised that RawTable isn't parametrized on the type of hash function. Something like this (possibly wrong way to express it, but you get the idea)

    fn search_entry_hashed<'a, K: Eq, V, H: SafeHash>(table: &'a mut RawTable<K,V,H>, hash: H, k: K)
        -> Entry<'a, K, V>

RawTable doesn't have to be because the hash function has already been computed at that point. The actual hash table is.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.