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

Function is_compressible

src/ast/ast_rewrite_same_clauses.c:330–347  ·  view source on GitHub ↗

returns true if AST clause type is compressible

Source from the content-addressed store, hash-verified

328
329// returns true if AST clause type is compressible
330static inline bool is_compressible
331(
332 const cypher_astnode_t *clause, // clause to check
333 cypher_astnode_type_t type // type of clause
334) {
335 // compressible clauses:
336 // 1. Non-OPTIONAL MATCH
337 // 2. CREATE
338 // 3. SET
339 // 4. DELETE
340 // 5. REMOVE
341 return ((type == CYPHER_AST_MATCH &&
342 !cypher_ast_match_is_optional(clause)) ||
343 type == CYPHER_AST_CREATE ||
344 type == CYPHER_AST_SET ||
345 type == CYPHER_AST_DELETE ||
346 type == CYPHER_AST_REMOVE);
347}
348
349// rewrite result by compressing consecutive clauses of the same type
350// to a single clause, returning true if the rewrite has been performed

Callers 1

_compress_clausesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected