| 175 | } |
| 176 | |
| 177 | EntityUpdateEvalCtx *UpdateCtx_Clone |
| 178 | ( |
| 179 | const EntityUpdateEvalCtx *orig |
| 180 | ) { |
| 181 | EntityUpdateEvalCtx *clone = rm_malloc(sizeof(EntityUpdateEvalCtx)); |
| 182 | |
| 183 | uint count = array_len(orig->properties); |
| 184 | |
| 185 | clone->alias = orig->alias; |
| 186 | clone->record_idx = orig->record_idx; |
| 187 | clone->properties = array_new(PropertySetCtx, count); |
| 188 | clone->add_labels = NULL; |
| 189 | clone->remove_labels = NULL; |
| 190 | if(orig->add_labels != NULL) { |
| 191 | array_clone(clone->add_labels, orig->add_labels); |
| 192 | } |
| 193 | if(orig->remove_labels != NULL) { |
| 194 | array_clone(clone->remove_labels, orig->remove_labels); |
| 195 | } |
| 196 | |
| 197 | for(uint i = 0; i < count; i ++) { |
| 198 | PropertySetCtx update = { |
| 199 | .attribute = orig->properties[i].attribute, |
| 200 | .exp = AR_EXP_Clone(orig->properties[i].exp), |
| 201 | .mode = orig->properties[i].mode, |
| 202 | }; |
| 203 | array_append(clone->properties, update); |
| 204 | } |
| 205 | |
| 206 | return clone; |
| 207 | } |
| 208 | |
| 209 | void UpdateCtx_Clear |
| 210 | ( |
nothing calls this directly
no test coverage detected