From da49f804ad5ae283c10ad757cd39bcc212b66f88 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Tue, 17 Oct 2017 17:27:19 +0200 Subject: Use assert instead of sp_log_err for something that shouldn't happen --- src/sp_utils.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/sp_utils.c b/src/sp_utils.c index 8731164..fdd2b66 100644 --- a/src/sp_utils.c +++ b/src/sp_utils.c @@ -42,11 +42,8 @@ zend_always_inline int is_regexp_matching(const pcre* regexp, const char* str) { int vec[30]; int ret = 0; - if (!regexp || !str) { - sp_log_err("regexp", "Something went wrong with a regexp (%d:%d).", - !regexp?0:1, !str?0:1); - return false; - } + assert(NULL != regexp); + assert(NULL != str); ret = sp_pcre_exec(regexp, NULL, str, strlen(str), 0, 0, vec, sizeof(vec)/sizeof(int)); -- cgit v1.3