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

Function gbuf_node_touched

src/graph_buffer/graph_buffer.c:1539–1551  ·  view source on GitHub ↗

Whether an edge of `types` (NULL-terminated) touches node `id`. */

Source from the content-addressed store, hash-verified

1537
1538/* Whether an edge of `types` (NULL-terminated) touches node `id`. */
1539static bool gbuf_node_touched(const cbm_gbuf_t *gb, int64_t id, const char *const *types) {
1540 for (int t = 0; types[t]; t++) {
1541 const cbm_gbuf_edge_t **edges = NULL;
1542 int count = 0;
1543 if ((cbm_gbuf_find_edges_by_target_type(gb, id, types[t], &edges, &count) == 0 &&
1544 count > 0) ||
1545 (cbm_gbuf_find_edges_by_source_type(gb, id, types[t], &edges, &count) == 0 &&
1546 count > 0)) {
1547 return true;
1548 }
1549 }
1550 return false;
1551}
1552
1553/* Delete the `label` nodes no edge of `types` (NULL-terminated) touches --
1554 * with `fileless`, only those carrying no file; returns how many. */

Callers 1

gbuf_delete_untouchedFunction · 0.85

Tested by

no test coverage detected