Skip to content

Commit 78f8281

Browse files
committed
refactor the code to be more readable
1 parent 32f85cf commit 78f8281

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
@@ -630,17 +630,18 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, in
630630
if (zv) {
631631
pcre_cache_entry *pce = (pcre_cache_entry*)Z_PTR_P(zv);
632632
#ifdef HAVE_PCRE_JIT_SUPPORT
633-
if ((bool)(pce->preg_options & PREG_JIT_ATTEMPTED) == jit_enabled) {
633+
bool recompile = (bool)(pce->preg_options & PREG_JIT_ATTEMPTED) != jit_enabled;
634+
#else
635+
bool recompile = false;
634636
#endif
637+
if (recompile) {
638+
zend_hash_del(&PCRE_G(pcre_cache), key);
639+
} else {
635640
if (key != regex) {
636641
zend_string_release_ex(key, 0);
637642
}
638643
return pce;
639-
#ifdef HAVE_PCRE_JIT_SUPPORT
640-
} else {
641-
zend_hash_del(&PCRE_G(pcre_cache), key);
642644
}
643-
#endif
644645
}
645646

646647
p = ZSTR_VAL(regex);

0 commit comments

Comments
 (0)