From 80cf2041596f5315f3c9e2cf018dd55018decf35 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 15 Nov 2019 18:53:14 +0000 Subject: [PATCH] [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 4a8d3309bc..2a5a9983c9 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 -- 2.47.3