summaryrefslogtreecommitdiff
path: root/Zend/zend_llist.c
diff options
context:
space:
mode:
authorAndrea Faulds <ajf@ajf.me>2014-09-16 13:45:06 +0100
committerAndrea Faulds <ajf@ajf.me>2014-09-16 13:45:06 +0100
commitdb72160e5ac2b267b9ffa23ad84e62e609382a44 (patch)
tree6e50c2826f98308d500cc826934a503751d4d566 /Zend/zend_llist.c
parentbe88d0e5d4ab5fdf775f3e38cf054aa0451f0d36 (diff)
parentf469dc7429f2257aac6f46228302408608fbd62f (diff)
downloadphp-git-db72160e5ac2b267b9ffa23ad84e62e609382a44.tar.gz
Merge branch 'master' into integer_semantics
Conflicts: Zend/zend_operators.h
Diffstat (limited to 'Zend/zend_llist.c')
-rw-r--r--Zend/zend_llist.c38
1 files changed, 16 insertions, 22 deletions
diff --git a/Zend/zend_llist.c b/Zend/zend_llist.c
index ad74bd56cb..0fb49abf5b 100644
--- a/Zend/zend_llist.c
+++ b/Zend/zend_llist.c
@@ -126,32 +126,26 @@ ZEND_API void zend_llist_clean(zend_llist *l)
}
-ZEND_API void *zend_llist_remove_tail(zend_llist *l)
+ZEND_API void zend_llist_remove_tail(zend_llist *l)
{
- zend_llist_element *old_tail;
- void *data;
-
- if ((old_tail = l->tail)) {
- if (old_tail->prev) {
- old_tail->prev->next = NULL;
- } else {
- l->head = NULL;
- }
-
- data = old_tail->data;
-
- l->tail = old_tail->prev;
- if (l->dtor) {
- l->dtor(data);
- }
- pefree(old_tail, l->persistent);
-
- --l->count;
+ zend_llist_element *old_tail = l->tail;
+ if (!old_tail) {
+ return;
+ }
- return data;
+ if (old_tail->prev) {
+ old_tail->prev->next = NULL;
+ } else {
+ l->head = NULL;
}
- return NULL;
+ l->tail = old_tail->prev;
+ --l->count;
+
+ if (l->dtor) {
+ l->dtor(old_tail->data);
+ }
+ pefree(old_tail, l->persistent);
}