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

Function AST_RewriteSameClauses

src/ast/ast_rewrite_same_clauses.c:351–370  ·  view source on GitHub ↗

rewrite result by compressing consecutive clauses of the same type to a single clause, returning true if the rewrite has been performed

Source from the content-addressed store, hash-verified

349// rewrite result by compressing consecutive clauses of the same type
350// to a single clause, returning true if the rewrite has been performed
351bool AST_RewriteSameClauses
352(
353 const cypher_astnode_t *root // root of AST
354) {
355 bool rewritten = false;
356
357 if(cypher_astnode_type(root) != CYPHER_AST_STATEMENT) {
358 return rewritten;
359 }
360
361 // retrieve the root's body
362 const cypher_astnode_t *body = cypher_ast_statement_get_body(root);
363 if(cypher_astnode_type(body) != CYPHER_AST_QUERY) {
364 return rewritten;
365 }
366
367 // traverse clauses
368 // compress consecutive clauses
369 return _compress_clauses(body);
370}

Callers 1

parse_queryFunction · 0.85

Calls 1

_compress_clausesFunction · 0.85

Tested by

no test coverage detected