(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:
Andrew Borodin 2016-05-01 08:56:03 +03:00
parent 1c22d44970
commit 1101ef2cd9

View File

@ -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)