mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
(mc_search__run_regex): minor optimization.
Since mc_search__run_regex() pften is called in various iterative procedures, don't reallocate regex buffer every time and use already allocated one before. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
1c22d44970
commit
1101ef2cd9
@ -878,9 +878,9 @@ mc_search__run_regex (mc_search_t * lc_mc_search, const void *user_data,
|
||||
gint end_pos;
|
||||
|
||||
if (lc_mc_search->regex_buffer != NULL)
|
||||
g_string_free (lc_mc_search->regex_buffer, TRUE);
|
||||
|
||||
lc_mc_search->regex_buffer = g_string_sized_new (64);
|
||||
g_string_set_size (lc_mc_search->regex_buffer, 0);
|
||||
else
|
||||
lc_mc_search->regex_buffer = g_string_sized_new (64);
|
||||
|
||||
virtual_pos = current_pos = start_search;
|
||||
while (virtual_pos <= end_search)
|
||||
|
Loading…
Reference in New Issue
Block a user