Commit 90aab73f authored by Mattias Engdegård's avatar Mattias Engdegård

More string-search optimisations

All-ASCII strings cannot have substrings with non-ASCII characters in
them; use this fact to avoid searching entirely.

* src/fns.c (Fstring_search): For multibyte non-ASCII needle and
unibyte haystack, don't check if the haystack is all-ASCII; it's a
waste of time. For multibyte non-ASCII needle and multibyte
all-ASCII haystack, fail immediately.
* test/src/fns-tests.el (string-search): Add more test cases.
parent 74a35d16
Pipeline #7845 passed with stage
in 64 minutes and 47 seconds