Karsten Hopp 11ecdc
To: vim_dev@googlegroups.com
Karsten Hopp 11ecdc
Subject: Patch 7.3.1027
Karsten Hopp 11ecdc
Fcc: outbox
Karsten Hopp 11ecdc
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 11ecdc
Mime-Version: 1.0
Karsten Hopp 11ecdc
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 11ecdc
Content-Transfer-Encoding: 8bit
Karsten Hopp 11ecdc
------------
Karsten Hopp 11ecdc
Karsten Hopp 11ecdc
Patch 7.3.1027
Karsten Hopp 11ecdc
Problem:    New regexp performance: Calling no_Magic() very often.
Karsten Hopp 11ecdc
Solution:   Remove magicness inline.
Karsten Hopp 11ecdc
Files:	    src/regexp_nfa.c
Karsten Hopp 11ecdc
Karsten Hopp 11ecdc
Karsten Hopp 11ecdc
*** ../vim-7.3.1026/src/regexp_nfa.c	2013-05-26 18:40:11.000000000 +0200
Karsten Hopp 11ecdc
--- src/regexp_nfa.c	2013-05-26 19:18:32.000000000 +0200
Karsten Hopp 11ecdc
***************
Karsten Hopp 11ecdc
*** 3563,3576 ****
Karsten Hopp 11ecdc
  		break;
Karsten Hopp 11ecdc
  
Karsten Hopp 11ecdc
  	    default:	/* regular character */
Karsten Hopp 11ecdc
  		/* TODO: put this in #ifdef later */
Karsten Hopp 11ecdc
! 		if (t->state->c < -256)
Karsten Hopp 11ecdc
! 		    EMSGN("INTERNAL: Negative state char: %ld", t->state->c);
Karsten Hopp 11ecdc
! 		result = (no_Magic(t->state->c) == curc);
Karsten Hopp 11ecdc
  
Karsten Hopp 11ecdc
! 		if (!result)
Karsten Hopp 11ecdc
! 		    result = ireg_ic == TRUE
Karsten Hopp 11ecdc
! 			       && MB_TOLOWER(t->state->c) == MB_TOLOWER(curc);
Karsten Hopp 11ecdc
  #ifdef FEAT_MBYTE
Karsten Hopp 11ecdc
  		/* If there is a composing character which is not being
Karsten Hopp 11ecdc
  		 * ignored there can be no match. Match with composing
Karsten Hopp 11ecdc
--- 3563,3580 ----
Karsten Hopp 11ecdc
  		break;
Karsten Hopp 11ecdc
  
Karsten Hopp 11ecdc
  	    default:	/* regular character */
Karsten Hopp 11ecdc
+ 	      {
Karsten Hopp 11ecdc
+ 		int c = t->state->c;
Karsten Hopp 11ecdc
+ 
Karsten Hopp 11ecdc
  		/* TODO: put this in #ifdef later */
Karsten Hopp 11ecdc
! 		if (c < -256)
Karsten Hopp 11ecdc
! 		    EMSGN("INTERNAL: Negative state char: %ld", c);
Karsten Hopp 11ecdc
! 		if (is_Magic(c))
Karsten Hopp 11ecdc
! 		    c = un_Magic(c);
Karsten Hopp 11ecdc
! 		result = (c == curc);
Karsten Hopp 11ecdc
  
Karsten Hopp 11ecdc
! 		if (!result && ireg_ic)
Karsten Hopp 11ecdc
! 		    result = MB_TOLOWER(c) == MB_TOLOWER(curc);
Karsten Hopp 11ecdc
  #ifdef FEAT_MBYTE
Karsten Hopp 11ecdc
  		/* If there is a composing character which is not being
Karsten Hopp 11ecdc
  		 * ignored there can be no match. Match with composing
Karsten Hopp 11ecdc
***************
Karsten Hopp 11ecdc
*** 3581,3586 ****
Karsten Hopp 11ecdc
--- 3585,3591 ----
Karsten Hopp 11ecdc
  #endif
Karsten Hopp 11ecdc
  		ADD_POS_NEG_STATE(t->state);
Karsten Hopp 11ecdc
  		break;
Karsten Hopp 11ecdc
+ 	      }
Karsten Hopp 11ecdc
  	    }
Karsten Hopp 11ecdc
  
Karsten Hopp 11ecdc
  	} /* for (thislist = thislist; thislist->state; thislist++) */
Karsten Hopp 11ecdc
*** ../vim-7.3.1026/src/version.c	2013-05-26 18:40:11.000000000 +0200
Karsten Hopp 11ecdc
--- src/version.c	2013-05-26 19:16:07.000000000 +0200
Karsten Hopp 11ecdc
***************
Karsten Hopp 11ecdc
*** 730,731 ****
Karsten Hopp 11ecdc
--- 730,733 ----
Karsten Hopp 11ecdc
  {   /* Add new patch number below this line */
Karsten Hopp 11ecdc
+ /**/
Karsten Hopp 11ecdc
+     1027,
Karsten Hopp 11ecdc
  /**/
Karsten Hopp 11ecdc
Karsten Hopp 11ecdc
-- 
Karsten Hopp 11ecdc
It doesn't really matter what you are able to do if you don't do it.
Karsten Hopp 11ecdc
				(Bram Moolenaar)
Karsten Hopp 11ecdc
Karsten Hopp 11ecdc
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 11ecdc
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 11ecdc
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 11ecdc
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///