Mercurial > vim
comparison src/buffer.c @ 4805:66803af09906 v7.3.1149
updated for version 7.3.1149
Problem: New regexp engine: Matching plain text could be faster.
Solution: Detect a plain text match and handle it specifically. Add
vim_regfree().
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 08 Jun 2013 18:19:48 +0200 |
parents | 8360a59aa04b |
children | ae05437a744a |
comparison
equal
deleted
inserted
replaced
4804:62663cfeb216 | 4805:66803af09906 |
---|---|
1896 clear_string_option(&buf->b_p_syn); | 1896 clear_string_option(&buf->b_p_syn); |
1897 #endif | 1897 #endif |
1898 #ifdef FEAT_SPELL | 1898 #ifdef FEAT_SPELL |
1899 clear_string_option(&buf->b_s.b_p_spc); | 1899 clear_string_option(&buf->b_s.b_p_spc); |
1900 clear_string_option(&buf->b_s.b_p_spf); | 1900 clear_string_option(&buf->b_s.b_p_spf); |
1901 vim_free(buf->b_s.b_cap_prog); | 1901 vim_regfree(buf->b_s.b_cap_prog); |
1902 buf->b_s.b_cap_prog = NULL; | 1902 buf->b_s.b_cap_prog = NULL; |
1903 clear_string_option(&buf->b_s.b_p_spl); | 1903 clear_string_option(&buf->b_s.b_p_spl); |
1904 #endif | 1904 #endif |
1905 #ifdef FEAT_SEARCHPATH | 1905 #ifdef FEAT_SEARCHPATH |
1906 clear_string_option(&buf->b_p_sua); | 1906 clear_string_option(&buf->b_p_sua); |
2244 break; | 2244 break; |
2245 } | 2245 } |
2246 match = buf->b_fnum; /* remember first match */ | 2246 match = buf->b_fnum; /* remember first match */ |
2247 } | 2247 } |
2248 | 2248 |
2249 vim_free(prog); | 2249 vim_regfree(prog); |
2250 if (match >= 0) /* found one match */ | 2250 if (match >= 0) /* found one match */ |
2251 break; | 2251 break; |
2252 } | 2252 } |
2253 | 2253 |
2254 /* Only search for unlisted buffers if there was no match with | 2254 /* Only search for unlisted buffers if there was no match with |
2353 if (round == 1) | 2353 if (round == 1) |
2354 { | 2354 { |
2355 *file = (char_u **)alloc((unsigned)(count * sizeof(char_u *))); | 2355 *file = (char_u **)alloc((unsigned)(count * sizeof(char_u *))); |
2356 if (*file == NULL) | 2356 if (*file == NULL) |
2357 { | 2357 { |
2358 vim_free(prog); | 2358 vim_regfree(prog); |
2359 if (patc != pat) | 2359 if (patc != pat) |
2360 vim_free(patc); | 2360 vim_free(patc); |
2361 return FAIL; | 2361 return FAIL; |
2362 } | 2362 } |
2363 } | 2363 } |
2364 } | 2364 } |
2365 vim_free(prog); | 2365 vim_regfree(prog); |
2366 if (count) /* match(es) found, break here */ | 2366 if (count) /* match(es) found, break here */ |
2367 break; | 2367 break; |
2368 } | 2368 } |
2369 | 2369 |
2370 if (patc != pat) | 2370 if (patc != pat) |