(mc_search_regex__get_max_num_of_replace_tokens): refactor loop.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2023-12-19 21:38:24 +03:00
parent 85b1cec81e
commit 2e33fd4fad
1 changed files with 3 additions and 4 deletions

View File

@ -397,17 +397,16 @@ mc_search_regex__get_max_num_of_replace_tokens (const gchar * str, gsize len)
{
int max_token = 0;
gsize loop;
for (loop = 0; loop < len - 1; loop++)
{
if (str[loop] == '\\' && g_ascii_isdigit (str[loop + 1]))
{
if (strutils_is_char_escaped (str, &str[loop]))
continue;
if (max_token < str[loop + 1] - '0')
max_token = str[loop + 1] - '0';
continue;
}
if (str[loop] == '$' && str[loop + 1] == '{')
else if (str[loop] == '$' && str[loop + 1] == '{')
{
gsize tmp_len;
@ -430,7 +429,7 @@ mc_search_regex__get_max_num_of_replace_tokens (const gchar * str, gsize len)
g_free (tmp_str);
}
}
}
return max_token;
}