X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/6208b3a77644afe5c7c28688cd6d7554a0281953..b84186ff2dadea9fa67f512a743ab97196390f56:/adlist.c?ds=sidebyside diff --git a/adlist.c b/adlist.c index 03bbfb79..fd2d6fd1 100644 --- a/adlist.c +++ b/adlist.c @@ -1,6 +1,6 @@ /* adlist.c - A generic doubly linked list implementation * - * Copyright (c) 2006-2009, Salvatore Sanfilippo + * Copyright (c) 2006-2010, Salvatore Sanfilippo * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -165,14 +165,14 @@ void listReleaseIterator(listIter *iter) { } /* Create an iterator in the list private iterator structure */ -void listRewind(list *list) { - list->iter.next = list->head; - list->iter.direction = AL_START_HEAD; +void listRewind(list *list, listIter *li) { + li->next = list->head; + li->direction = AL_START_HEAD; } -void listRewindTail(list *list) { - list->iter.next = list->tail; - list->iter.direction = AL_START_TAIL; +void listRewindTail(list *list, listIter *li) { + li->next = list->tail; + li->direction = AL_START_TAIL; } /* Return the next element of an iterator. @@ -202,11 +202,6 @@ listNode *listNext(listIter *iter) return current; } -/* List Yield just call listNext() against the list private iterator */ -listNode *listYield(list *list) { - return listNext(&list->iter); -} - /* Duplicate the whole list. On out of memory NULL is returned. * On success a copy of the original list is returned. *