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

Function _AR_EXP_CloneOp

src/arithmetic/arithmetic_expression.c:147–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147static AR_ExpNode *_AR_EXP_CloneOp(AR_ExpNode *exp) {
148 const char *func_name = exp->op.f->name;
149 bool include_internal = exp->op.f->internal;
150 uint child_count = exp->op.child_count;
151 AR_ExpNode *clone = AR_EXP_NewOpNode(func_name, include_internal, child_count);
152 AR_Func_Clone clone_cb = clone->op.f->callbacks.clone;
153 void *pdata = exp->op.private_data;
154 if(clone_cb != NULL) {
155 // clone callback specified, use it to duplicate function's private data
156 clone->op.private_data = clone_cb(exp->op.private_data);
157 }
158
159 // clone child nodes
160 for(uint i = 0; i < exp->op.child_count; i++) {
161 AR_ExpNode *child = AR_EXP_Clone(exp->op.children[i]);
162 clone->op.children[i] = child;
163 }
164
165 return clone;
166}
167
168static void _AR_EXP_ValidateArgsCount
169(

Callers 1

AR_EXP_CloneFunction · 0.85

Calls 2

AR_EXP_NewOpNodeFunction · 0.85
AR_EXP_CloneFunction · 0.85

Tested by

no test coverage detected