mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +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);
|
pcre_cache_entry *pce = (pcre_cache_entry *) Z_PTR_P(data);
|
||||||
int *num_clean = (int *)arg;
|
int *num_clean = (int *)arg;
|
||||||
|
|
||||||
if (*num_clean > 0 && !pce->refcount) {
|
if (!pce->refcount) {
|
||||||
(*num_clean)--;
|
if (--(*num_clean) == 0) {
|
||||||
|
return ZEND_HASH_APPLY_REMOVE|ZEND_HASH_APPLY_STOP;
|
||||||
|
}
|
||||||
return ZEND_HASH_APPLY_REMOVE;
|
return ZEND_HASH_APPLY_REMOVE;
|
||||||
} else {
|
} else {
|
||||||
return ZEND_HASH_APPLY_KEEP;
|
return ZEND_HASH_APPLY_KEEP;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue