delete all references to a node from any relevant index
| 10 | |
| 11 | // delete all references to a node from any relevant index |
| 12 | static void _DeleteNodeFromIndices |
| 13 | ( |
| 14 | GraphContext *gc, |
| 15 | Node *n |
| 16 | ) { |
| 17 | ASSERT(n != NULL); |
| 18 | ASSERT(gc != NULL); |
| 19 | |
| 20 | Schema *s = NULL; |
| 21 | Graph *g = gc->g; |
| 22 | EntityID node_id = ENTITY_GET_ID(n); |
| 23 | |
| 24 | // retrieve node labels |
| 25 | uint label_count; |
| 26 | NODE_GET_LABELS(g, n, label_count); |
| 27 | |
| 28 | for(uint i = 0; i < label_count; i++) { |
| 29 | int label_id = labels[i]; |
| 30 | s = GraphContext_GetSchemaByID(gc, label_id, SCHEMA_NODE); |
| 31 | ASSERT(s != NULL); |
| 32 | |
| 33 | // update any indices this entity is represented in |
| 34 | Schema_RemoveNodeFromIndices(s, n); |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | static void _DeleteEdgeFromIndices |
| 39 | ( |
no test coverage detected