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

Function _AR_EXP_CloneOperand

src/arithmetic/arithmetic_expression.c:105–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105static AR_ExpNode *_AR_EXP_CloneOperand
106(
107 const AR_ExpNode *exp
108) {
109 AR_ExpNode *clone = rm_calloc(1, sizeof(AR_ExpNode));
110 clone->type = AR_EXP_OPERAND;
111
112 switch(exp->operand.type) {
113 case AR_EXP_CONSTANT:
114 clone->operand.type = AR_EXP_CONSTANT;
115 clone->operand.constant = SI_ShallowCloneValue(exp->operand.constant);
116 break;
117 case AR_EXP_VARIADIC:
118 clone->operand.type = exp->operand.type;
119 clone->operand.variadic.entity_alias = exp->operand.variadic.entity_alias;
120 clone->operand.variadic.entity_alias_idx = exp->operand.variadic.entity_alias_idx;
121 break;
122 case AR_EXP_PARAM:
123 clone->operand.type = AR_EXP_PARAM;
124 clone->operand.param_name = exp->operand.param_name;
125 break;
126 case AR_EXP_BORROW_RECORD:
127 clone->operand.type = AR_EXP_BORROW_RECORD;
128 break;
129 default:
130 ASSERT(false);
131 break;
132 }
133
134 return clone;
135}
136
137static AR_ExpNode *_AR_EXP_NewOpNode(uint child_count) {
138 AR_ExpNode *node = rm_calloc(1, sizeof(AR_ExpNode));

Callers 1

AR_EXP_CloneFunction · 0.85

Calls 2

rm_callocFunction · 0.85
SI_ShallowCloneValueFunction · 0.85

Tested by

no test coverage detected