1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Using continued lines in a Vim script can be slow.
12 Solution: Instead of reallocating for every line use a growarray. (Yasuhiro
17 *** ../vim-7.3.432/src/ex_cmds2.c 2012-02-04 21:57:44.000000000 +0100
18 --- src/ex_cmds2.c 2012-02-05 23:06:31.000000000 +0100
22 /* compensate for the one line read-ahead */
26 ! sp->nextline = get_one_sourceline(sp);
27 ! if (sp->nextline == NULL)
29 ! p = skipwhite(sp->nextline);
32 ! s = alloc((unsigned)(STRLEN(line) + STRLEN(p)));
33 ! if (s == NULL) /* out of memory */
39 ! vim_free(sp->nextline);
45 /* compensate for the one line read-ahead */
48 ! /* Get the next line and concatenate it when it starts with a
49 ! * backslash. We always need to read the next line, keep it in
51 ! sp->nextline = get_one_sourceline(sp);
52 ! if (sp->nextline != NULL && *(p = skipwhite(sp->nextline)) == '\\')
56 ! ga_init2(&ga, (int)sizeof(char_u), 200);
57 ! ga_concat(&ga, line);
58 ! ga_concat(&ga, p + 1);
61 ! vim_free(sp->nextline);
62 ! sp->nextline = get_one_sourceline(sp);
63 ! if (sp->nextline == NULL)
65 ! p = skipwhite(sp->nextline);
68 ! ga_concat(&ga, p + 1);
70 ! ga_append(&ga, NUL);
76 *** ../vim-7.3.432/src/version.c 2012-02-05 22:51:27.000000000 +0100
77 --- src/version.c 2012-02-05 23:09:21.000000000 +0100
81 { /* Add new patch number below this line */
87 Due knot trussed yore spell chequer two fined awl miss steaks.
89 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
90 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
91 \\\ an exciting new programming language -- http://www.Zimbu.org ///
92 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///