Low level child removal from node. The new node pointer (after the child * removal) is returned. Note that this function does not fix the pointer * of the parent node in its parent, so this task is up to the caller. * The function never fails for out of memory. */
| 1209 | * of the parent node in its parent, so this task is up to the caller. |
| 1210 | * The function never fails for out of memory. */ |
| 1211 | raxNode *raxRemoveChild(raxNode *parent, raxNode *child) { |
| 1212 | raxNode **cp = raxNodeFirstChildPtr(parent); |
| 1213 | while(1) { |
| 1214 | raxNode *aux; |
| 1215 | memcpy(&aux,cp,sizeof(aux)); |
| 1216 | if (aux == child) break; |
| 1217 | cp++; |
| 1218 | } |
| 1219 | return raxRemoveChildAtPtr(parent,cp); |
| 1220 | } |
| 1221 | |
| 1222 | /* Free the useless node 'h' that was left after a deletion, and keep moving |
| 1223 | * upward while the parent would also become a non-key single-child node. |
no test coverage detected