File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 */
You can’t perform that action at this time.
0 commit comments