Skip to content

Commit b3d8284

Browse files
committed
fix C89 compat
1 parent ce04268 commit b3d8284

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/spl/spl_dllist.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,12 +1260,12 @@ SPL_METHOD(SplDoublyLinkedList, add)
12601260
/* If index is the last entry+1 then we do a push because we're not inserting before any entry */
12611261
spl_ptr_llist_push(intern->llist, value TSRMLS_CC);
12621262
} else {
1263-
/* Get the element we want to insert before */
1264-
element = spl_ptr_llist_offset(intern->llist, index, intern->flags & SPL_DLLIST_IT_LIFO);
1265-
12661263
/* Create the new element we want to insert */
12671264
spl_ptr_llist_element *elem = emalloc(sizeof(spl_ptr_llist_element));
12681265

1266+
/* Get the element we want to insert before */
1267+
element = spl_ptr_llist_offset(intern->llist, index, intern->flags & SPL_DLLIST_IT_LIFO);
1268+
12691269
elem->data = value;
12701270
elem->rc = 1;
12711271
/* connect to the neighbours */

0 commit comments

Comments
 (0)