Skip to content

Commit 31197da

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

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
@@ -647,17 +647,18 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, in
647647
if (zv) {
648648
pcre_cache_entry *pce = (pcre_cache_entry*)Z_PTR_P(zv);
649649
#ifdef HAVE_PCRE_JIT_SUPPORT
650-
if ((bool)(pce->preg_options & PREG_JIT_ATTEMPTED) == jit_enabled) {
650+
bool recompile = (bool)(pce->preg_options & PREG_JIT_ATTEMPTED) != jit_enabled;
651+
#else
652+
bool recompile = false;
651653
#endif
654+
if (recompile) {
655+
zend_hash_del(&PCRE_G(pcre_cache), key);
656+
} else {
652657
if (key != regex) {
653658
zend_string_release_ex(key, 0);
654659
}
655660
return pce;
656-
#ifdef HAVE_PCRE_JIT_SUPPORT
657-
} else {
658-
zend_hash_del(&PCRE_G(pcre_cache), key);
659661
}
660-
#endif
661662
}
662663

663664
p = ZSTR_VAL(regex);

0 commit comments

Comments
 (0)