-/* Delete the element pointed to. */
-static void lDelete(lIterator *li, int direction) {
- if (li->encoding == REDIS_ENCODING_ZIPLIST) {
- direction = (direction == REDIS_HEAD) ? ZIPLIST_HEAD : ZIPLIST_TAIL;
- li->subject->ptr = ziplistDelete(li->subject->ptr,&li->zi,direction);
- } else if (li->encoding == REDIS_ENCODING_LIST) {
- listNode *next;
- if (direction == REDIS_HEAD)
- next = li->ln->prev;
- else
- next = li->ln->next;
- listDelNode(li->subject->ptr,li->ln);
- li->ln = next;
- } else {
- redisPanic("Unknown list encoding");
- }
-}
-