]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Use ref impl for small strings
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 Nov 2019 18:53:14 +0000 (18:53 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 Nov 2019 18:53:14 +0000 (18:53 +0000)
contrib/fastutf8/fastutf8.c

index 4a8d3309bc8192da386e407ec1fc20f79954b28e..2a5a9983c99a28a1a2b91089a5de46dadfc89169 100644 (file)
@@ -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