summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2014-11-29 21:06:49 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2014-11-30 16:05:34 +0100
commit370852e8685ee39342c03498c9bfa7294d31ab3a (patch)
treed2c5aa5ad91886ba5e47270943dc3e6389f9bb25 /src
parentffdf6ed373fa38d2bfd2f2e51cfe5db742ae6b77 (diff)
Simplify remove_delimiter
Diffstat (limited to 'src')
-rw-r--r--src/inlines.c12
1 files 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);
}