]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.455 v7.3.455
authorBram Moolenaar <Bram@vim.org>
Wed, 22 Feb 2012 17:29:33 +0000 (18:29 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 22 Feb 2012 17:29:33 +0000 (18:29 +0100)
Problem:    Using many continuation lines can be slow.
Solution:   Adjust the reallocation size to the current length.

src/ex_cmds2.c
src/version.c

index 92cd73358e8a16efce1f128d3314a2f8c72246d6..4e480ecafa4b763b83d000daa1eb845204e96656 100644 (file)
@@ -3448,7 +3448,7 @@ getsourceline(c, cookie, indent)
        {
            garray_T    ga;
 
-           ga_init2(&ga, (int)sizeof(char_u), 200);
+           ga_init2(&ga, (int)sizeof(char_u), 400);
            ga_concat(&ga, line);
            ga_concat(&ga, p + 1);
            for (;;)
@@ -3460,6 +3460,15 @@ getsourceline(c, cookie, indent)
                p = skipwhite(sp->nextline);
                if (*p != '\\')
                    break;
+               /* Adjust the growsize to the current length to speed up
+                * concatenating many lines. */
+               if (ga.ga_len > 400)
+               {
+                   if (ga.ga_len > 8000)
+                       ga.ga_growsize = 8000;
+                   else
+                       ga.ga_growsize = ga.ga_len;
+               }
                ga_concat(&ga, p + 1);
            }
            ga_append(&ga, NUL);
index 169b9efe6c2c8c7b42a8c28365e57f121551d367..7945ffee02a92923bfbcacad38fffa43372c64b1 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    455,
 /**/
     454,
 /**/