Commit:    fad960a4045da86cdbd8308a165ffc47892f05b9
Author:    Pierrick Charron <pierr...@php.net>         Tue, 25 Dec 2012 
20:45:24 -0500
Parents:   a2b6d9c1047a4e5f3419ebc3489a66d62aa12d07
Branches:  PHP-5.3 PHP-5.4 PHP-5.5 master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=fad960a4045da86cdbd8308a165ffc47892f05b9

Log:
Remove a useless memory write in zend_llist_del_element

The zend_llist_element *next pointer is not necessary and removing
it will also remove a write on memory

Changed paths:
  M  Zend/zend_llist.c


Diff:
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);
                        break;
                }
-               current = next;
+               current = current->next;
        }
 }


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to