add node to any relevant index
| 53 | |
| 54 | // add node to any relevant index |
| 55 | static void _AddNodeToIndices |
| 56 | ( |
| 57 | GraphContext *gc, |
| 58 | Node *n |
| 59 | ) { |
| 60 | ASSERT(n != NULL); |
| 61 | ASSERT(gc != NULL); |
| 62 | |
| 63 | Schema *s = NULL; |
| 64 | Graph *g = gc->g; |
| 65 | EntityID node_id = ENTITY_GET_ID(n); |
| 66 | |
| 67 | // retrieve node labels |
| 68 | uint label_count; |
| 69 | NODE_GET_LABELS(g, n, label_count); |
| 70 | |
| 71 | for(uint i = 0; i < label_count; i++) { |
| 72 | int label_id = labels[i]; |
| 73 | s = GraphContext_GetSchemaByID(gc, label_id, SCHEMA_NODE); |
| 74 | ASSERT(s != NULL); |
| 75 | Schema_AddNodeToIndices(s, n); |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | // add edge to any relevant index |
| 80 | static void _AddEdgeToIndices(GraphContext *gc, Edge *e) { |
no test coverage detected