(mc_search_prepare): fix coding style, reduce variable scope.

This commit is contained in:
Andrew Borodin 2022-09-24 09:41:51 +03:00
parent 837ecc9aeb
commit 761b7952cb

View File

@ -214,24 +214,27 @@ mc_search_prepare (mc_search_t * lc_mc_search)
ret = g_ptr_array_new ();
#ifdef HAVE_CHARSET
if (lc_mc_search->is_all_charsets)
if (!lc_mc_search->is_all_charsets)
g_ptr_array_add (ret,
mc_search__cond_struct_new (lc_mc_search, lc_mc_search->original.str,
lc_mc_search->original.charset));
else
{
gsize loop1;
for (loop1 = 0; loop1 < codepages->len; loop1++)
{
const char *id;
GString *buffer;
id = ((codepage_desc *) g_ptr_array_index (codepages, loop1))->id;
if (g_ascii_strcasecmp (id, lc_mc_search->original.charset) == 0)
{
g_ptr_array_add (ret,
mc_search__cond_struct_new (lc_mc_search,
lc_mc_search->original.str,
lc_mc_search->original.charset));
continue;
}
else
{
GString *buffer;
buffer =
mc_search__recode_str (lc_mc_search->original.str->str,
@ -241,11 +244,6 @@ mc_search_prepare (mc_search_t * lc_mc_search)
g_string_free (buffer, TRUE);
}
}
else
{
g_ptr_array_add (ret,
mc_search__cond_struct_new (lc_mc_search, lc_mc_search->original.str,
lc_mc_search->original.charset));
}
#else
g_ptr_array_add (ret,