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

@ -879,16 +879,16 @@ mf_alloc_bhdr(memfile_T *mfp, int page_count)
{
bhdr_T *hp;
if ((hp = ALLOC_ONE(bhdr_T)) != NULL)
if ((hp = ALLOC_ONE(bhdr_T)) == NULL)
return NULL;
if ((hp->bh_data = alloc((size_t)mfp->mf_page_size * page_count))
== NULL)
{
if ((hp->bh_data = alloc((size_t)mfp->mf_page_size * page_count))
== NULL)
{
vim_free(hp); // not enough memory
return NULL;
}
hp->bh_page_count = page_count;
vim_free(hp); // not enough memory
return NULL;
}
hp->bh_page_count = page_count;
return hp;
}
@ -1209,12 +1209,12 @@ mf_set_ffname(memfile_T *mfp)
void
mf_fullname(memfile_T *mfp)
{
if (mfp != NULL && mfp->mf_fname != NULL && mfp->mf_ffname != NULL)
{
vim_free(mfp->mf_fname);
mfp->mf_fname = mfp->mf_ffname;
mfp->mf_ffname = NULL;
}
if (mfp == NULL || mfp->mf_fname == NULL || mfp->mf_ffname == NULL)
return;
vim_free(mfp->mf_fname);
mfp->mf_fname = mfp->mf_ffname;
mfp->mf_ffname = NULL;
}
/*