Skip to content

Commit c32a7cc

Browse files
committed
Remove unnecessary php_phongo_cursor_free_current() call
The current element is already freed at the top of this function. After that point, the element could only be intialized from first_batch_iter (after which we return immediately) or if mongoc_cursor_next() returns true (in which case we wouldn't be in this else clause).
1 parent efd9181 commit c32a7cc

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

php_phongo.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,9 +1632,6 @@ static void php_phongo_cursor_iterator_move_forward(zend_object_iterator *iter T
16321632
if (mongoc_cursor_next(cursor->cursor, &doc)) {
16331633
MAKE_STD_ZVAL(cursor->visitor_data.zchild);
16341634
bson_to_zval(bson_get_data(doc), doc->len, &cursor->visitor_data);
1635-
} else {
1636-
/* TODO: is this really necessary? */
1637-
php_phongo_cursor_free_current(cursor);
16381635
}
16391636
} /* }}} */
16401637

0 commit comments

Comments
 (0)