Skip to main content

hash_set_order

Function hash_set_order 

Source
pub fn hash_set_order<'k>(
    keys: impl IntoIterator<Item = &'k str>,
) -> Vec<&'k str>
Expand description

Returns keys in the order the game’s chained hash sets iterate them, given their insertion order.

The set starts with [HASH_SET_FIRST_BUCKETS] buckets and grows to twice plus one when it holds more keys than buckets (its maximum load is 1); keys go to the end of the chain of bucket key_hash modulo the bucket count, and growing moves them bucket by bucket. Repeated keys are kept once. Verified in Thrones’ DLL (constructor FUN_10b46290, inserts like FUN_10b65220).