luaur-common 0.1.3

Foundational data structures and flags for the luaur Luau-in-Rust toolchain.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::records::dense_hash_table::DenseHashTable;

impl<K, I, Iface, H, E> DenseHashTable<K, I, Iface, H, E>
where
    K: Clone,
    Iface: crate::records::dense_hash_table::ItemInterface<K, I>,
    H: crate::records::dense_hash_table::DenseHasher<K> + Default,
    E: crate::records::dense_hash_table::DenseEq<K> + Default,
{
    pub(crate) fn dense_hash_table_rehash_if_full(&mut self, key: &K) {
        if self.count >= self.capacity * 3 / 4 && self.find(key).is_none() {
            DenseHashTable::<K, I, Iface, H, E>::rehash(self);
        }
    }
}