commit 80cf204: [Minor] Use ref impl for small strings

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Nov 15 18:56:14 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-11-15 18:53:14 +0000
URL: https://github.com/rspamd/rspamd/commit/80cf2041596f5315f3c9e2cf018dd55018decf35 (HEAD -> master)

[Minor] Use ref impl for small strings

---
 contrib/fastutf8/fastutf8.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/contrib/fastutf8/fastutf8.c b/contrib/fastutf8/fastutf8.c
index 4a8d3309b..2a5a9983c 100644
--- a/contrib/fastutf8/fastutf8.c
+++ b/contrib/fastutf8/fastutf8.c
@@ -154,5 +154,7 @@ rspamd_fast_utf8_library_init (unsigned flags)
 off_t
 rspamd_fast_utf8_validate (const unsigned char *data, size_t len)
 {
-	return validate_func (data, len);
+	return len >= 64 ?
+			validate_func (data, len) :
+			rspamd_fast_utf8_validate_ref (data, len);
 }
\ No newline at end of file


More information about the Commits mailing list