MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_ht_set

Function cbm_ht_set

src/foundation/hash_table.c:68–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void *cbm_ht_set(CBMHashTable *ht, const char *key, void *value) {
69 if (!ht || !key)
70 return NULL;
71 /* Capture previous value (if any) before overwriting.
72 * Verstable's _insert overwrites silently and returns an iterator
73 * to the (now updated) entry — we have to peek first to surface
74 * the prior value to the caller (back-compat with our API). */
75 void *prev = NULL;
76 cbm_vt_itr itr = cbm_vt_get(&ht->vt, key);
77 if (!cbm_vt_is_end(itr)) {
78 prev = itr.data->val;
79 }
80 (void)cbm_vt_insert(&ht->vt, key, value);
81 return prev;
82}
83
84void *cbm_ht_get(const CBMHashTable *ht, const char *key) {
85 if (!ht || !key)

Callers 15

cbm_quarantine_loadFunction · 0.85
cbm_run_kotlin_lsp_crossFunction · 0.85
ensure_pretrained_mapFunction · 0.85
corpus_get_or_addFunction · 0.85
cov_rebuild_shadow_graphFunction · 0.85
dependent_files_chunkFunction · 0.85
gb_internFunction · 0.85
get_or_create_node_arrayFunction · 0.85
get_or_create_edge_arrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected