def ins_slot

bend-collections-laws-math@1.0.0.0 · src/containers/hash_table.bend:414

import bend-collections-laws-math@1.0.0.0/src/containers/hash_table.bend as HashTable
import Base

414# The new entry's slot s is chosen; its bucket is at (or, after growth, found anew).
415def ins_slot(a, -V: Kind(a), +n: U32, +mask: U32, +td: U32, +fresh: U32, +sz: U32, +sd: U32, +free: U32, tab: Array<U32>, ks: Array<String>, vs: Array<Maybe<a, V>>, nx: Array<U32>, +s: U32, +at: U32, +w: U32, key: String, x: V, over: Bool) -> HashMap<a, V>:
416  match over:
417    case False{}:
418      ins_fin(a, V, n, mask, td, fresh, sz, sd, free, put_bucket(tab, at, w, link(s)), nx, store(a, V, ks, vs, s, key, x))
419    case True{}:
420      ins_fin(a, V, n, U32.inc(U32.shl(mask)), U32.inc(td), fresh, sz, sd, free, ins_raw(grow_tab(mask, td, tab), U32.inc(U32.shl(mask)), w, link(s)), nx, store(a, V, ks, vs, s, key, x))

Uses (14)

Used by (2)