Skip to content

Commit cb73327

Browse files
committed
refactor the code to be more readable
1 parent 77e72f5 commit cb73327

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ext/pcre/php_pcre.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -645,19 +645,19 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, in
645645
back the compiled pattern, otherwise go on and compile it. */
646646
zv = zend_hash_find(&PCRE_G(pcre_cache), key);
647647
if (zv) {
648-
pcre_cache_entry *pce = (pcre_cache_entry*)Z_PTR_P(zv);
649648
#ifdef HAVE_PCRE_JIT_SUPPORT
650-
if ((bool)(pce->preg_options & PREG_JIT_ATTEMPTED) == jit_enabled) {
649+
bool recompile = (bool)(pce->preg_options & PREG_JIT_ATTEMPTED) != jit_enabled;
650+
#else
651+
bool recompile = false;
651652
#endif
653+
if (recompile) {
654+
zend_hash_del(&PCRE_G(pcre_cache), key);
655+
} else {
652656
if (key != regex) {
653657
zend_string_release_ex(key, 0);
654658
}
655-
return pce;
656-
#ifdef HAVE_PCRE_JIT_SUPPORT
657-
} else {
658-
zend_hash_del(&PCRE_G(pcre_cache), key);
659+
return (pcre_cache_entry*)Z_PTR_P(zv);
659660
}
660-
#endif
661661
}
662662

663663
p = ZSTR_VAL(regex);

0 commit comments

Comments
 (0)