From 67e5913edf2a61be2cd9047a14632134268faa80 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 29 Jan 2020 10:54:30 +0100 Subject: [PATCH] tweaks: move another function to before the one that calls it --- src/nano.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/nano.c b/src/nano.c index 658b803f..c81ae68b 100644 --- a/src/nano.c +++ b/src/nano.c @@ -109,21 +109,6 @@ void splice_node(linestruct *afterthis, linestruct *newnode) openfile->filebot = newnode; } -/* Disconnect a node from a linked list of linestructs and delete it. */ -void unlink_node(linestruct *line) -{ - if (line->prev != NULL) - line->prev->next = line->next; - if (line->next != NULL) - line->next->prev = line->prev; - - /* Update filebot when removing a node at the end of file. */ - if (openfile && openfile->filebot == line) - openfile->filebot = line->prev; - - delete_node(line); -} - /* Free the data structures in the given node. */ void delete_node(linestruct *line) { @@ -139,6 +124,21 @@ void delete_node(linestruct *line) free(line); } +/* Disconnect a node from a linked list of linestructs and delete it. */ +void unlink_node(linestruct *line) +{ + if (line->prev != NULL) + line->prev->next = line->next; + if (line->next != NULL) + line->next->prev = line->prev; + + /* Update filebot when removing a node at the end of file. */ + if (openfile && openfile->filebot == line) + openfile->filebot = line->prev; + + delete_node(line); +} + /* Make a copy of a linestruct node. */ linestruct *copy_node(const linestruct *src) {