tweaks: remove a superfluous check for NULL plus the associated message

The message has been there for a year and no one ever reported seeing it.
master
Benno Schulenberg 2019-04-03 15:11:18 +02:00
parent 5375403b9d
commit aa2568858e
1 changed files with 1 additions and 10 deletions

View File

@ -178,16 +178,7 @@ void free_lines(linestruct *src)
/* Renumber the lines in a buffer, starting with the given line. */ /* Renumber the lines in a buffer, starting with the given line. */
void renumber(linestruct *line) void renumber(linestruct *line)
{ {
ssize_t number; ssize_t number = (line->prev == NULL) ? 0 : line->prev->lineno;
if (line == NULL) {
#ifndef NANO_TINY
statusline(ALERT, "Trying to renumber nothing -- please report a bug");
#endif
return;
}
number = (line->prev == NULL) ? 0 : line->prev->lineno;
while (line != NULL) { while (line != NULL) {
line->lineno = ++number; line->lineno = ++number;