From d7d3a876249074ba78fe03f177d2889464f32293 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 17 May 2016 18:22:42 +0200 Subject: [PATCH] tweaks: elide an unneeded variable --- src/browser.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/browser.c b/src/browser.c index 09e4c195..ae890f1b 100644 --- a/src/browser.c +++ b/src/browser.c @@ -99,8 +99,6 @@ char *do_browser(char *path, DIR *dir) while (TRUE) { struct stat st; int i; - size_t fileline = selected / width; - /* The line number the selected file is on. */ char *new_path; /* The path we switch to at the "Go to Directory" * prompt. */ @@ -146,7 +144,7 @@ char *do_browser(char *path, DIR *dir) wmouse_trafo(edit, &mouse_y, &mouse_x, FALSE)) { /* longest is the width of each column. There * are two spaces between each column. */ - selected = (fileline / editwinrows) * (editwinrows * width) + + selected = selected - selected % (editwinrows * width) + (mouse_y * width) + (mouse_x / (longest + 2)); /* If they clicked beyond the end of a row, @@ -526,7 +524,7 @@ void browser_refresh(void) wmove(edit, 0, 0); - i = width * editwinrows * ((selected / width) / editwinrows); + i = selected - selected % (editwinrows * width); for (; i < filelist_len && line < editwinrows; i++) { struct stat st;