Commit d7d3a876 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

tweaks: elide an unneeded variable

No related merge requests found
Showing with 2 additions and 4 deletions
+2 -4
...@@ -99,8 +99,6 @@ char *do_browser(char *path, DIR *dir) ...@@ -99,8 +99,6 @@ char *do_browser(char *path, DIR *dir)
while (TRUE) { while (TRUE) {
struct stat st; struct stat st;
int i; int i;
size_t fileline = selected / width;
/* The line number the selected file is on. */
char *new_path; char *new_path;
/* The path we switch to at the "Go to Directory" /* The path we switch to at the "Go to Directory"
* prompt. */ * prompt. */
...@@ -146,7 +144,7 @@ char *do_browser(char *path, DIR *dir) ...@@ -146,7 +144,7 @@ char *do_browser(char *path, DIR *dir)
wmouse_trafo(edit, &mouse_y, &mouse_x, FALSE)) { wmouse_trafo(edit, &mouse_y, &mouse_x, FALSE)) {
/* longest is the width of each column. There /* longest is the width of each column. There
* are two spaces between each column. */ * are two spaces between each column. */
selected = (fileline / editwinrows) * (editwinrows * width) + selected = selected - selected % (editwinrows * width) +
(mouse_y * width) + (mouse_x / (longest + 2)); (mouse_y * width) + (mouse_x / (longest + 2));
/* If they clicked beyond the end of a row, /* If they clicked beyond the end of a row,
...@@ -526,7 +524,7 @@ void browser_refresh(void) ...@@ -526,7 +524,7 @@ void browser_refresh(void)
wmove(edit, 0, 0); wmove(edit, 0, 0);
i = width * editwinrows * ((selected / width) / editwinrows); i = selected - selected % (editwinrows * width);
for (; i < filelist_len && line < editwinrows; i++) { for (; i < filelist_len && line < editwinrows; i++) {
struct stat st; struct stat st;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment