Skip to content

Instantly share code, notes, and snippets.

Created December 26, 2012 01:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
zend_llist_del_element improvement
diff --git a/Zend/zend_llist.c b/Zend/zend_llist.c
index 4656420..26baf4d 100644
--- a/Zend/zend_llist.c
+++ b/Zend/zend_llist.c
@@ -91,15 +91,13 @@ ZEND_API void zend_llist_prepend_element(zend_llist *l, void *element)
ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare)(void *element1, void *element2))
zend_llist_element *current=l->head;
- zend_llist_element *next;
while (current) {
- next = current->next;
if (compare(current->data, element)) {
DEL_LLIST_ELEMENT(current, l);
- current = next;
+ current = current->next;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment