diff options
| author | Rosen Penev <rosenp@gmail.com> | 2020-04-18 22:16:22 -0700 |
|---|---|---|
| committer | Rosen Penev <rosenp@gmail.com> | 2020-04-20 13:20:59 -0700 |
| commit | 042f62dfc514da177c148c257e4dcb32e5f8379d (patch) | |
| tree | 01c1fcf37bc8d5439a82cca46fa7cb39f88126f3 /disk-utils/cfdisk.c | |
| parent | bd89499e07a85b399a345e319e61d0afc5f3088c (diff) | |
| download | util-linux-042f62dfc514da177c148c257e4dcb32e5f8379d.tar.gz | |
[clang-tidy] do not use else after return
Found with readability-else-after-return
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'disk-utils/cfdisk.c')
| -rw-r--r-- | disk-utils/cfdisk.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c index 89e54d6f43..2fb442dc33 100644 --- a/disk-utils/cfdisk.c +++ b/disk-utils/cfdisk.c @@ -986,7 +986,9 @@ static size_t menuitem_get_line(struct cfdisk *cf, size_t idx) if (!m->page_sz) /* small menu */ return (ui_lines - (cf->menu->nitems + 1)) / 2 + idx; return (idx % m->page_sz) + 1; - } else { + } + + { size_t len = MENU_H_ITEMWIDTH(m) + MENU_H_BETWEEN; /** item width */ size_t items = ui_cols / len; /* items per line */ @@ -1003,7 +1005,9 @@ static int menuitem_get_column(struct cfdisk *cf, size_t idx) if ((size_t) ui_cols <= nc) return 0; return (ui_cols - nc) / 2; - } else { + } + + { size_t len = MENU_H_ITEMWIDTH(cf->menu) + MENU_H_BETWEEN; /* item width */ size_t items = ui_cols / len; /* items per line */ size_t extra = items < cf->menu->nitems ? /* extra space on line */ @@ -1877,7 +1881,7 @@ static int ui_get_size(struct cfdisk *cf, /* context */ if (rc == 0) { ui_warnx(_("Please, specify size.")); continue; /* nothing specified */ - } else if (rc == -CFDISK_ERR_ESC) + } if (rc == -CFDISK_ERR_ESC) break; /* cancel dialog */ if (strcmp(buf, dflt) == 0) |
