Zig 0.17.0-dev (Split by item) This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig standard library.
std › array_hash_map › ArrayHashMap › setKeyContext Public Function setKeyContext Doc Source Public Function std.array_hash_map.ArrayHashMap.setKeyContext
pub fn setKeyContext (self : *Self , index : usize , new_key : K , ctx : Context ) void Params self : *Self index : usize new_key : K ctx : Context File array_hash_map.zig: 895
895
896
897
898
899
900
901
902
903
904
905
906
907
908 pub fn setKeyContext (self : *Self , index : usize , new_key : K , ctx : Context ) void {
if (self .index_header ) |header | {
self .removeFromIndexByIndex (index , if (store_hash ) {} else ctx , header );
self .entries .items (.key )[index ] = new_key ;
const h = checkedHash (ctx , new_key );
if (store_hash ) self .entries .items (.hash )[index ] = h ;
insertEntryIntoNewHeader (header , h , index );
} else {
self .entries .items (.key )[index ] = new_key ;
if (store_hash ) self .entries .items (.hash )[index ] = checkedHash (ctx , new_key );
}
}