MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _QueryGraph_ExtractEdge

Function _QueryGraph_ExtractEdge

src/graph/query_graph.c:183–201  ·  view source on GitHub ↗

extracts edge from 'qg' and places a copy of into 'graph'

Source from the content-addressed store, hash-verified

181
182// extracts edge from 'qg' and places a copy of into 'graph'
183static void _QueryGraph_ExtractEdge
184(
185 const QueryGraph *qg,
186 QueryGraph *graph,
187 QGNode *left,
188 QGNode *right,
189 const cypher_astnode_t *ast_edge
190) {
191 const char *alias = AST_ToString(ast_edge);
192
193 // validate input, edge shouldn't be in graph
194 ASSERT(left != NULL);
195 ASSERT(right != NULL);
196 ASSERT(QueryGraph_GetEdgeByAlias(graph, alias) == NULL);
197
198 QGEdge *e = QueryGraph_GetEdgeByAlias(qg, alias);
199 bool shortest_path = e ? e->shortest_path : false;
200 _QueryGraphAddEdge(graph, ast_edge, left, right, shortest_path);
201}
202
203// clones path from 'qg' into 'graph'
204static void _QueryGraph_ExtractPath

Callers 1

_QueryGraph_ExtractPathFunction · 0.85

Calls 3

AST_ToStringFunction · 0.85
_QueryGraphAddEdgeFunction · 0.85

Tested by

no test coverage detected