Mercurial > vim
changeset 4480:035fb0d5e7ce v7.3.988
updated for version 7.3.988
Problem: New regexp engine is slow.
Solution: Break out of the loop when the state list is empty.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 21 May 2013 14:03:00 +0200 |
parents | a720548104ea |
children | 407cdb221614 |
files | src/regexp_nfa.c src/version.c |
diffstat | 2 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -2951,6 +2951,11 @@ again: #ifdef NFA_REGEXP_DEBUG_LOG fprintf(debug, "\n-------------------\n"); #endif + /* + * If the state lists are empty we can stop. + */ + if (thislist->n == 0 && neglist->n == 0) + break; /* compute nextlist */ for (i = 0; i < thislist->n || neglist->n > 0; ++i)