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

Function unindex_edge

src/graph_buffer/graph_buffer.c:455–471  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

453
454/* Remove an edge from all indexes (dedup + source_type + target_type + type). */
455static void unindex_edge(cbm_gbuf_t *gb, const cbm_gbuf_edge_t *e) {
456 char key[EDGE_KEY_BUF];
457
458 make_edge_key(key, sizeof(key), e->source_id, e->target_id, e->type, e->properties_json);
459 uint64_t h0;
460 uint64_t h1;
461 edge_key_hash(key, &h0, &h1);
462 edge_key_map_delete(&gb->edge_by_key, h0, h1);
463
464 make_src_type_key(key, sizeof(key), e->source_id, e->type);
465 remove_edge_from_ptr_array(cbm_ht_get(gb->edges_by_source_type, key), e->id);
466
467 make_src_type_key(key, sizeof(key), e->target_id, e->type);
468 remove_edge_from_ptr_array(cbm_ht_get(gb->edges_by_target_type, key), e->id);
469
470 remove_edge_from_ptr_array(cbm_ht_get(gb->edges_by_type, e->type), e->id);
471}
472
473/* Cascade-delete all edges touching nodes in deleted_set. */
474static 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
edge_key_hashFunction · 0.85
edge_key_map_deleteFunction · 0.85
make_src_type_keyFunction · 0.85
cbm_ht_getFunction · 0.85

Tested by

no test coverage detected