Fuzion Logo
flang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

CTrie

🌌CTrie

the ctrie
NYI marking ctrie as ref see issue https://github.com/tokiwa-software/fuzion/issues/304

§  add(k CTK, v CTV)
 => 
unit
:
Object

add key value
if key is already present value is updated

clean an indirection node:
compress contained container node

turns this: CNode -> INode -> TNode -> SNode
into this: CNode -> SNode

compress a container node

contract a container node

takes two single nodes and returns either
MainNode -> CNode -> SNodes
or
MainNode -> LNode -> SNodes
or recurse
MainNode -> CNode -> INode -> dual x y

find k in linked nodes

returns flag and the position in the CNode for given params

convert u64 hash to u32 hash

lookup an element with bracket syntax
redefines map.index [ ]:
get the value k is mapped to, or nil if none.

a snapshot of the ctrie as sequence auf key-value tuples
redefines map.items:
get a sequence of all key/value pairs in this map

lookup key k

read root
if root is currently a descriptor commit the descriptor first

remove key from ctrie
calls iremove which does the actual removal

the size of the ctrie
redefines map.size:
number of entries in this map

take a snapshot of the ctrie

the width of the branching factor, 2^5 = 32