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

Function unindex_edge

src/graph_buffer/graph_buffer.c:298–313  ·  view source on GitHub ↗

Remove an edge from all indexes (dedup + source_type + target_type + type). */

Source from the content-addressed store, hash-verified

296
297/* Remove an edge from all indexes (dedup + source_type + target_type + type). */
298static void unindex_edge(cbm_gbuf_t *gb, const cbm_gbuf_edge_t *e) {
299 char key[EDGE_KEY_BUF];
300
301 make_edge_key(key, sizeof(key), e->source_id, e->target_id, e->type, e->properties_json);
302 const char *ekey = cbm_ht_get_key(gb->edge_by_key, key);
303 cbm_ht_delete(gb->edge_by_key, key);
304 free((void *)ekey);
305
306 make_src_type_key(key, sizeof(key), e->source_id, e->type);
307 remove_edge_from_ptr_array(cbm_ht_get(gb->edges_by_source_type, key), e->id);
308
309 make_src_type_key(key, sizeof(key), e->target_id, e->type);
310 remove_edge_from_ptr_array(cbm_ht_get(gb->edges_by_target_type, key), e->id);
311
312 remove_edge_from_ptr_array(cbm_ht_get(gb->edges_by_type, e->type), e->id);
313}
314
315/* Cascade-delete all edges touching nodes in deleted_set. */
316static void cascade_delete_edges(cbm_gbuf_t *gb, CBMHashTable *deleted_set) {

Callers 1

cascade_delete_edgesFunction · 0.85

Calls 6

make_edge_keyFunction · 0.85
cbm_ht_get_keyFunction · 0.85
cbm_ht_deleteFunction · 0.85
make_src_type_keyFunction · 0.85
cbm_ht_getFunction · 0.85

Tested by

no test coverage detected