tweaks: rename a parameter and a variable, to be more distinct

master
Benno Schulenberg 2019-05-24 19:27:04 +02:00
parent 35a791dee5
commit 65560a583c
1 changed files with 9 additions and 9 deletions

View File

@ -495,19 +495,19 @@ void get_range(const linestruct **top, const linestruct **bot)
} }
} }
/* Given a line number, return a pointer to the corresponding struct. */ /* Return a pointer to the line that has the given line number. */
linestruct *line_from_number(ssize_t lineno) linestruct *line_from_number(ssize_t number)
{ {
linestruct *f = openfile->current; linestruct *line = openfile->current;
if (lineno <= openfile->current->lineno) if (line->lineno > number)
while (f->lineno != lineno) while (line->lineno != number)
f = f->prev; line = line->prev;
else else
while (f->lineno != lineno) while (line->lineno != number)
f = f->next; line = line->next;
return f; return line;
} }
#endif /* !NANO_TINY */ #endif /* !NANO_TINY */