diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-11-05 13:19:41 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-11-05 13:22:28 -0800 |
commit | 8403ff2798a60a7d9df73a1129a5bc125c378a36 (patch) | |
tree | b7a0f4d26cd45a3e639adf7ab566042119129478 /src/inlines.c | |
parent | b56b8cbe99222ce5e1ab0d144a95cb697b93761d (diff) |
Improved free_inlines.
Diffstat (limited to 'src/inlines.c')
-rw-r--r-- | src/inlines.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/inlines.c b/src/inlines.c index a43012f..0f1a3d3 100644 --- a/src/inlines.c +++ b/src/inlines.c @@ -124,17 +124,16 @@ inline static node_inl* make_simple(int t) // Utility function used by free_inlines void splice_into_list(node_inl* e, node_inl* children) { node_inl * tmp; - tmp = children; - if (!tmp) { - return ; - } - // Find last child - while (tmp->next) { - tmp = tmp->next; + if (children) { + tmp = children; + // Find last child + while (tmp->next) { + tmp = tmp->next; + } + // Splice children into list + tmp->next = e->next; + e->next = children; } - // Splice children into list - tmp->next = e->next; - e->next = children; return ; } |