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

Function unindex_edge

src/graph_buffer/graph_buffer.c:302–317  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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