Skip to content

Commit f29dcc1

Browse files
committed
Remove redundant check in SplObjectStorage->count
1 parent 984df80 commit f29dcc1

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

ext/spl/spl_observer.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -507,15 +507,7 @@ PHP_METHOD(SplObjectStorage, count)
507507
}
508508

509509
if (mode == COUNT_RECURSIVE) {
510-
zend_long ret;
511-
512-
if (mode != COUNT_RECURSIVE) {
513-
ret = zend_hash_num_elements(&intern->storage);
514-
} else {
515-
ret = php_count_recursive(&intern->storage);
516-
}
517-
518-
RETURN_LONG(ret);
510+
RETURN_LONG(php_count_recursive(&intern->storage));
519511
return;
520512
}
521513

0 commit comments

Comments
 (0)