mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Use APPLY_STOP in pcre_clean_cache() (GH-15839)
Once num_clean has reached 0, we never remove any more elements anyway. Closes GH-15839
This commit is contained in:
parent
1facbc385a
commit
ffb440550c
1 changed files with 4 additions and 2 deletions
|
@ -494,8 +494,10 @@ static int pcre_clean_cache(zval *data, void *arg)
|
|||
pcre_cache_entry *pce = (pcre_cache_entry *) Z_PTR_P(data);
|
||||
int *num_clean = (int *)arg;
|
||||
|
||||
if (*num_clean > 0 && !pce->refcount) {
|
||||
(*num_clean)--;
|
||||
if (!pce->refcount) {
|
||||
if (--(*num_clean) == 0) {
|
||||
return ZEND_HASH_APPLY_REMOVE|ZEND_HASH_APPLY_STOP;
|
||||
}
|
||||
return ZEND_HASH_APPLY_REMOVE;
|
||||
} else {
|
||||
return ZEND_HASH_APPLY_KEEP;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue