Browse Source

Avoid extra-allocation of string while prepare to regexp-search.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Slava Zanko 14 years ago
parent
commit
601047b6a1
1 changed files with 1 additions and 2 deletions
  1. 1 2
      lib/search/regex.c

+ 1 - 2
lib/search/regex.c

@@ -532,8 +532,7 @@ mc_search__cond_struct_new_init_regex (const char *charset, mc_search_t * lc_mc_
 
     if (!lc_mc_search->is_case_sensitive)
     {
-        tmp = g_string_new_len (mc_search_cond->str->str, mc_search_cond->str->len);
-        g_string_free (mc_search_cond->str, TRUE);
+        tmp = mc_search_cond->str;
         mc_search_cond->str = mc_search__cond_struct_new_regex_ci_str (charset, tmp->str, tmp->len);
         g_string_free (tmp, TRUE);
     }