mirror of
git://git.sv.gnu.org/nano.git
synced 2025-01-10 11:32:11 +03:00
tweaks: remove two unneeded checks for NULL
If the rest of nano is correct, then these checks are superfluous and only slow the loops down. But if there is some incorrect code, then let nano crash on dereferencing NULL so we can find and fix the bug.
This commit is contained in:
parent
98ffb19746
commit
35a791dee5
@ -501,10 +501,10 @@ linestruct *line_from_number(ssize_t lineno)
|
||||
linestruct *f = openfile->current;
|
||||
|
||||
if (lineno <= openfile->current->lineno)
|
||||
while (f->lineno != lineno && f->prev != NULL)
|
||||
while (f->lineno != lineno)
|
||||
f = f->prev;
|
||||
else
|
||||
while (f->lineno != lineno && f->next != NULL)
|
||||
while (f->lineno != lineno)
|
||||
f = f->next;
|
||||
|
||||
return f;
|
||||
|
Loading…
Reference in New Issue
Block a user