summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-10-20 15:17:02 +0800
committerMaxime Coste <mawww@kakoune.org>2017-11-01 14:05:15 +0800
commitd9b4076e3ca0f4f58e6a9bdea741e919d4ee3f6c (patch)
treec293ce60e9d7a77e08fa6d8f1ef375671997a686 /src/input_handler.cc
parent3f627058b0df498630797d7cfbfa3825cb5ad5d8 (diff)
Regex: Go back to instruction based search of next start
The previous method, which was a bit faster in the general use case, can hit some cases where we get quadratic behaviour and very slow matching. By using an instruction, we can guarantee our complexity of O(N*M) as we will never have more than N threads (N being the instruction count) and we run the threads once per codepoint in the subject string. That slows down the general case slightly, but ensure we dont have pathological cases. This new version is much faster than the previous instruction based search because it does not use a plain `.*` searcher, but a specific, smarter instruction specialized for finding the next start if we are in the correct conditions.
Diffstat (limited to 'src/input_handler.cc')
0 files changed, 0 insertions, 0 deletions