Mercurial > vim
diff src/regexp_nfa.c @ 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 | ab5154170c3d |
children | cd005ab15ef3 |
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)