]>
Commit | Line | Data |
---|---|---|
c6060300 MT |
1 | To: vim_dev@googlegroups.com |
2 | Subject: Patch 7.3.433 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.3.433 | |
11 | Problem: Using continued lines in a Vim script can be slow. | |
12 | Solution: Instead of reallocating for every line use a growarray. (Yasuhiro | |
13 | Matsumoto) | |
14 | Files: src/ex_cmds2.c | |
15 | ||
16 | ||
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 | |
19 | *************** | |
20 | *** 3439,3460 **** | |
21 | { | |
22 | /* compensate for the one line read-ahead */ | |
23 | --sourcing_lnum; | |
24 | ! for (;;) | |
25 | { | |
26 | ! sp->nextline = get_one_sourceline(sp); | |
27 | ! if (sp->nextline == NULL) | |
28 | ! break; | |
29 | ! p = skipwhite(sp->nextline); | |
30 | ! if (*p != '\\') | |
31 | ! break; | |
32 | ! s = alloc((unsigned)(STRLEN(line) + STRLEN(p))); | |
33 | ! if (s == NULL) /* out of memory */ | |
34 | ! break; | |
35 | ! STRCPY(s, line); | |
36 | ! STRCAT(s, p + 1); | |
37 | vim_free(line); | |
38 | ! line = s; | |
39 | ! vim_free(sp->nextline); | |
40 | } | |
41 | } | |
42 | ||
43 | --- 3439,3470 ---- | |
44 | { | |
45 | /* compensate for the one line read-ahead */ | |
46 | --sourcing_lnum; | |
47 | ! | |
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 | |
50 | ! * sp->nextline. */ | |
51 | ! sp->nextline = get_one_sourceline(sp); | |
52 | ! if (sp->nextline != NULL && *(p = skipwhite(sp->nextline)) == '\\') | |
53 | { | |
54 | ! garray_T ga; | |
55 | ! | |
56 | ! ga_init2(&ga, (int)sizeof(char_u), 200); | |
57 | ! ga_concat(&ga, line); | |
58 | ! ga_concat(&ga, p + 1); | |
59 | ! for (;;) | |
60 | ! { | |
61 | ! vim_free(sp->nextline); | |
62 | ! sp->nextline = get_one_sourceline(sp); | |
63 | ! if (sp->nextline == NULL) | |
64 | ! break; | |
65 | ! p = skipwhite(sp->nextline); | |
66 | ! if (*p != '\\') | |
67 | ! break; | |
68 | ! ga_concat(&ga, p + 1); | |
69 | ! } | |
70 | ! ga_append(&ga, NUL); | |
71 | vim_free(line); | |
72 | ! line = ga.ga_data; | |
73 | } | |
74 | } | |
75 | ||
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 | |
78 | *************** | |
79 | *** 716,717 **** | |
80 | --- 716,719 ---- | |
81 | { /* Add new patch number below this line */ | |
82 | + /**/ | |
83 | + 433, | |
84 | /**/ | |
85 | ||
86 | -- | |
87 | Due knot trussed yore spell chequer two fined awl miss steaks. | |
88 | ||
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 /// |