diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-06-10 23:53:15 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-06-10 23:53:15 -0700 |
commit | aa2f771502ad48842bf084ccd67aaa19cac590c0 (patch) | |
tree | 85220dfda8303c58a6d6f3383f1579c5499babca | |
parent | 1acd161b2f25e71a40c903ea8997a6ee2f4694d2 (diff) |
Code simplification.
-rw-r--r-- | src/inlines.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/inlines.c b/src/inlines.c index a1f0356..c04e793 100644 --- a/src/inlines.c +++ b/src/inlines.c @@ -440,7 +440,7 @@ static void process_emphasis(subject *subj, delimiter *start_delim) delimiter *closer = subj->last_delim; delimiter *opener; delimiter *old_closer; - bool opener_not_found; + bool opener_found; // move back to first relevant delim. while (closer != NULL && closer->previous != start_delim) { @@ -454,15 +454,15 @@ static void process_emphasis(subject *subj, delimiter *start_delim) closer->delim_char == '"' || closer->delim_char == '\'')) { // Now look backwards for first matching opener: opener = closer->previous; + opener_found = false; while (opener != NULL && opener != start_delim) { if (opener->delim_char == closer->delim_char && opener->can_open) { + opener_found = true; break; } opener = opener->previous; } - opener_not_found = opener == NULL || - opener == start_delim; old_closer = closer; if (closer->delim_char == '*' || closer->delim_char == '_') { if (opener != NULL && opener != start_delim) { @@ -491,7 +491,7 @@ static void process_emphasis(subject *subj, delimiter *start_delim) } closer = closer->next; } - if (opener_not_found && !old_closer->can_open) { + if (!opener_found && !old_closer->can_open) { // we can remove a closer that can't be an // opener, once we've seen there's no // matching opener: |