]> git.lyx.org Git - features.git/commit
FindAdv: Significantly increase the search speed
authorKornel Benko <kornel@lyx.org>
Tue, 13 Nov 2018 11:11:33 +0000 (12:11 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 12:39:51 +0000 (14:39 +0200)
commited5ea4a03b3ddb2d7e145841caaf53cf897a427f
tree2d763dac32d937c23dd4699c57167ee6febb7e08
parent8ca5f50bf787a69c58a13cd96038c122f90c857a
FindAdv: Significantly increase the search speed

The needed time to find a simple string dependes on the
paragraph length was O(n^2)
Now it is down to O(n).
Before:
To determine if the pattern matches we compared the
paragraph from current position to the its end.
Increment current position if no match
Now:
Check if the character at current position has at least
the needed features (text, color, language etc)
If not, Increment current position
else proceed as before
src/lyxfind.cpp