0
0
mirror of https://github.com/vim/vim.git synced 2025-11-08 10:27:32 -05:00

patch 9.0.1196: code is indented more than necessary

Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes #11813)
This commit is contained in:
Yegappan Lakshmanan
2023-01-14 12:32:28 +00:00
committed by Bram Moolenaar
parent 378e6c03f9
commit e857598896
16 changed files with 678 additions and 676 deletions

View File

@@ -151,20 +151,20 @@ get_mess_env(void)
char_u *p;
p = mch_getenv((char_u *)"LC_ALL");
if (p == NULL || *p == NUL)
{
p = mch_getenv((char_u *)"LC_MESSAGES");
if (p == NULL || *p == NUL)
{
p = mch_getenv((char_u *)"LANG");
if (p != NULL && VIM_ISDIGIT(*p))
p = NULL; // ignore something like "1043"
if (p != NULL && *p != NUL)
return p;
p = mch_getenv((char_u *)"LC_MESSAGES");
if (p != NULL && *p != NUL)
return p;
p = mch_getenv((char_u *)"LANG");
if (p != NULL && VIM_ISDIGIT(*p))
p = NULL; // ignore something like "1043"
# ifdef HAVE_GET_LOCALE_VAL
if (p == NULL || *p == NUL)
p = get_locale_val(LC_CTYPE);
if (p == NULL || *p == NUL)
p = get_locale_val(LC_CTYPE);
# endif
}
}
return p;
}
#endif
@@ -504,11 +504,11 @@ find_locales(void)
static void
init_locales(void)
{
if (!did_init_locales)
{
did_init_locales = TRUE;
locales = find_locales();
}
if (did_init_locales)
return;
did_init_locales = TRUE;
locales = find_locales();
}
# if defined(EXITFREE) || defined(PROTO)
@@ -516,12 +516,13 @@ init_locales(void)
free_locales(void)
{
int i;
if (locales != NULL)
{
for (i = 0; locales[i] != NULL; i++)
vim_free(locales[i]);
VIM_CLEAR(locales);
}
if (locales == NULL)
return;
for (i = 0; locales[i] != NULL; i++)
vim_free(locales[i]);
VIM_CLEAR(locales);
}
# endif