/// Append a key-value pair, *without* checking whether it already exists,
/// and return the pair's new index.
Append a key-value pair, *without* checking whether it already exists,
and return the pair's new index.
Append a key - value pair * without * checking whether it already exists and return the pair ' s new index .
fn push(&mut self, hash: HashValue, key: K, value: V) -> usize {
        let i = self.entries.len();
        self.indices.insert(hash.get(), i, get_hash(&self.entries));
        if i == self.entries.capacity() {
            // Reserve our own capacity synced to the indices,
            // rather than letting `Vec::push` just double it.
            self.reserve_entries();
        }
        self.entries.push(Bucket { hash, key, value });
        i
    }
fn push ( & mut self , hash : HashValue , key : K , value : V ) -> usize { let i = self . entries . len ( ) ; self . indices . insert ( hash . get ( ) , i , get_hash ( & self . entries ) ) ; if i == self . entries . capacity ( ) { // Reserve our own capacity synced to the indices, // rather than letting `Vec::push` just double it. self . reserve_entries ( ) ; } self . entries . push ( Bucket { hash , key , value } ) ; i }
Append a key-value pair, *without* checking whether it already exists,
and return the pair's new index.
Append a key - value pair * without * checking whether it already exists and return the pair ' s new index .
&mut self
hash
HashValue
key
K
value
V