comparison src/regexp_nfa.c @ 4559:04086e297563 v7.3.1027

updated for version 7.3.1027 Problem: New regexp performance: Calling no_Magic() very often. Solution: Remove magicness inline.
author Bram Moolenaar <bram@vim.org>
date Sun, 26 May 2013 19:19:52 +0200
parents 888c12c899e5
children 4d81fdda8f35
comparison
equal deleted inserted replaced
4558:8d7f7d198970 4559:04086e297563
3561 case NFA_ZSTART: 3561 case NFA_ZSTART:
3562 /* TODO: should not happen? */ 3562 /* TODO: should not happen? */
3563 break; 3563 break;
3564 3564
3565 default: /* regular character */ 3565 default: /* regular character */
3566 {
3567 int c = t->state->c;
3568
3566 /* TODO: put this in #ifdef later */ 3569 /* TODO: put this in #ifdef later */
3567 if (t->state->c < -256) 3570 if (c < -256)
3568 EMSGN("INTERNAL: Negative state char: %ld", t->state->c); 3571 EMSGN("INTERNAL: Negative state char: %ld", c);
3569 result = (no_Magic(t->state->c) == curc); 3572 if (is_Magic(c))
3570 3573 c = un_Magic(c);
3571 if (!result) 3574 result = (c == curc);
3572 result = ireg_ic == TRUE 3575
3573 && MB_TOLOWER(t->state->c) == MB_TOLOWER(curc); 3576 if (!result && ireg_ic)
3577 result = MB_TOLOWER(c) == MB_TOLOWER(curc);
3574 #ifdef FEAT_MBYTE 3578 #ifdef FEAT_MBYTE
3575 /* If there is a composing character which is not being 3579 /* If there is a composing character which is not being
3576 * ignored there can be no match. Match with composing 3580 * ignored there can be no match. Match with composing
3577 * character uses NFA_COMPOSING above. */ 3581 * character uses NFA_COMPOSING above. */
3578 if (result && enc_utf8 && !ireg_icombine 3582 if (result && enc_utf8 && !ireg_icombine
3579 && clen != utf_char2len(curc)) 3583 && clen != utf_char2len(curc))
3580 result = FALSE; 3584 result = FALSE;
3581 #endif 3585 #endif
3582 ADD_POS_NEG_STATE(t->state); 3586 ADD_POS_NEG_STATE(t->state);
3583 break; 3587 break;
3588 }
3584 } 3589 }
3585 3590
3586 } /* for (thislist = thislist; thislist->state; thislist++) */ 3591 } /* for (thislist = thislist; thislist->state; thislist++) */
3587 3592
3588 /* Look for the start of a match in the current position by adding the 3593 /* Look for the start of a match in the current position by adding the