]> git.eshelyaron.com Git - emacs.git/commit
More string-search optimisations
authorMattias Engdegård <mattiase@acm.org>
Thu, 19 Nov 2020 13:24:24 +0000 (14:24 +0100)
committerMattias Engdegård <mattiase@acm.org>
Thu, 19 Nov 2020 13:58:48 +0000 (14:58 +0100)
commit90aab73f8d6b5fd0a8adb706c8ae669564f23c56
tree08e62c3c7a97b0c6b531a70785b26b8f4505ae79
parent74a35d16e25bdb07d847b980008fc4d25ab9404e
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.
src/fns.c
test/src/fns-tests.el