Skip to content

Commit d607227

Browse files
committed
refactor the code to be more readable
1 parent 8341489 commit d607227

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

ext/pcre/php_pcre.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -632,17 +632,18 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, in
632632
if (zv) {
633633
pcre_cache_entry *pce = (pcre_cache_entry*)Z_PTR_P(zv);
634634
#ifdef HAVE_PCRE_JIT_SUPPORT
635-
if ((bool)(pce->preg_options & PREG_JIT_ATTEMPTED) == jit_enabled) {
635+
bool recompile = (bool)(pce->preg_options & PREG_JIT_ATTEMPTED) != jit_enabled;
636+
#else
637+
bool recompile = false;
636638
#endif
639+
if (recompile) {
640+
zend_hash_del(&PCRE_G(pcre_cache), key);
641+
} else {
637642
if (key != regex) {
638643
zend_string_release_ex(key, 0);
639644
}
640645
return pce;
641-
#ifdef HAVE_PCRE_JIT_SUPPORT
642-
} else {
643-
zend_hash_del(&PCRE_G(pcre_cache), key);
644646
}
645-
#endif
646647
}
647648

648649
p = ZSTR_VAL(regex);

0 commit comments

Comments
 (0)