refactor: follow style guide

- reduce variable scope
- prefer initialization over declaration and assignment
This commit is contained in:
dundargoc
2023-11-13 23:40:37 +01:00
committed by dundargoc
parent 1798a4b5e9
commit ac1113ded5
52 changed files with 713 additions and 1269 deletions

View File

@@ -2931,8 +2931,6 @@ static void u_freebranch(buf_T *buf, u_header_T *uhp, u_header_T **uhpp)
/// @param uhpp if not NULL reset when freeing this header
static void u_freeentries(buf_T *buf, u_header_T *uhp, u_header_T **uhpp)
{
u_entry_T *uep, *nuep;
// Check for pointers to the header that become invalid now.
if (buf->b_u_curhead == uhp) {
buf->b_u_curhead = NULL;
@@ -2944,7 +2942,8 @@ static void u_freeentries(buf_T *buf, u_header_T *uhp, u_header_T **uhpp)
*uhpp = NULL;
}
for (uep = uhp->uh_entry; uep != NULL; uep = nuep) {
u_entry_T *nuep;
for (u_entry_T *uep = uhp->uh_entry; uep != NULL; uep = nuep) {
nuep = uep->ue_next;
u_freeentry(uep, uep->ue_size);
}