From 7963580d72a358975133f86f01de2d2eab08ba38 Mon Sep 17 00:00:00 2001 From: xXx-caillou-xXx Date: Fri, 13 Jul 2018 10:36:50 +0200 Subject: Massively optimize how rules are handled This commit does a lot of things: - Use hashtables instead of lists to store the rules - Rules that can be applied at launch time won't be tried at runtime - Improve feedback when writing nonsensical rules - Make intensive use of `zend_string` instead of `char*`--- src/sp_pcre_compat.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/sp_pcre_compat.h') diff --git a/src/sp_pcre_compat.h b/src/sp_pcre_compat.h index a9eb253..6658316 100644 --- a/src/sp_pcre_compat.h +++ b/src/sp_pcre_compat.h @@ -27,6 +27,8 @@ #endif sp_pcre* sp_pcre_compile(const char* str); +#define sp_is_regexp_matching_zend(regexp, zstr) \ + sp_is_regexp_matching_len(regexp, ZSTR_VAL(zstr), ZSTR_LEN(zstr)) #define sp_is_regexp_matching(regexp, str) \ sp_is_regexp_matching_len(regexp, str, strlen(str)) bool sp_is_regexp_matching_len(const sp_pcre* regexp, const char* str, size_t len); -- cgit v1.3