Delete one entry from list given the node for the entry and a pointer * to the entry in the node. * * Note: quicklistDelIndex() *requires* uncompressed nodes because you * already had to get *p from an uncompressed node somewhere. * * Returns 1 if the entire node was deleted, 0 if node still exists. * Also updates in/out param 'p' with the next offset in the ziplist. */
| 635 | * Returns 1 if the entire node was deleted, 0 if node still exists. |
| 636 | * Also updates in/out param 'p' with the next offset in the ziplist. */ |
| 637 | REDIS_STATIC int quicklistDelIndex(quicklist *quicklist, quicklistNode *node, |
| 638 | unsigned char **p) { |
| 639 | int gone = 0; |
| 640 | |
| 641 | node->zl = ziplistDelete(node->zl, p); |
| 642 | node->count--; |
| 643 | if (node->count == 0) { |
| 644 | gone = 1; |
| 645 | __quicklistDelNode(quicklist, node); |
| 646 | } else { |
| 647 | quicklistNodeUpdateSz(node); |
| 648 | } |
| 649 | quicklist->count--; |
| 650 | /* If we deleted the node, the original node is no longer valid */ |
| 651 | return gone ? 1 : 0; |
| 652 | } |
| 653 | |
| 654 | /* Delete one element represented by 'entry' |
| 655 | * |
no test coverage detected