diff options
| author | xXx-caillou-xXx | 2018-07-13 10:36:50 +0200 |
|---|---|---|
| committer | jvoisin | 2018-07-13 08:36:50 +0000 |
| commit | 7963580d72a358975133f86f01de2d2eab08ba38 (patch) | |
| tree | 4bec345d70f687a2a6002b36e2f2fc79318959f6 /src/sp_pcre_compat.h | |
| parent | 12b740bc7bb01ffe397cecc5b6fa25b136304911 (diff) | |
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*`
Diffstat (limited to 'src/sp_pcre_compat.h')
| -rw-r--r-- | src/sp_pcre_compat.h | 2 |
1 files changed, 2 insertions, 0 deletions
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 @@ | |||
| 27 | #endif | 27 | #endif |
| 28 | 28 | ||
| 29 | sp_pcre* sp_pcre_compile(const char* str); | 29 | sp_pcre* sp_pcre_compile(const char* str); |
| 30 | #define sp_is_regexp_matching_zend(regexp, zstr) \ | ||
| 31 | sp_is_regexp_matching_len(regexp, ZSTR_VAL(zstr), ZSTR_LEN(zstr)) | ||
| 30 | #define sp_is_regexp_matching(regexp, str) \ | 32 | #define sp_is_regexp_matching(regexp, str) \ |
| 31 | sp_is_regexp_matching_len(regexp, str, strlen(str)) | 33 | sp_is_regexp_matching_len(regexp, str, strlen(str)) |
| 32 | bool sp_is_regexp_matching_len(const sp_pcre* regexp, const char* str, size_t len); | 34 | bool sp_is_regexp_matching_len(const sp_pcre* regexp, const char* str, size_t len); |
