From 370852e8685ee39342c03498c9bfa7294d31ab3a Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Sat, 29 Nov 2014 21:06:49 +0100 Subject: Simplify remove_delimiter --- src/inlines.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/inlines.c b/src/inlines.c index 63f8036..7ef5e78 100644 --- a/src/inlines.c +++ b/src/inlines.c @@ -283,17 +283,13 @@ static void remove_delimiter(subject *subj, delimiter *delim) if (delim->next == NULL) { // end of list: assert(delim == subj->last_delim); - if (delim->previous != NULL) { - delim->previous->next = NULL; - } subj->last_delim = delim->previous; - } else if (delim->previous == NULL) { - // start of list, with something after it - delim->next->previous = NULL; - } else { // neither start nor end: - delim->previous->next = delim->next; + } else { delim->next->previous = delim->previous; } + if (delim->previous != NULL) { + delim->previous->next = delim->next; + } free(delim); } -- cgit v1.2.3