aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2020-05-18 01:24:08 -0400
committerHolden Rohrer <hr@hrhr.dev>2020-05-18 01:24:31 -0400
commit38c700a0915aa6cf6b2111f6ae72c584f16d4826 (patch)
treef2d1659ddbdf47c75ecd4588840e73b805c9f4cf
parent9cb31de0aef51bce0c753e3c64637c106e846d36 (diff)
Removed an unnecessary goto and 3 lines
-rw-r--r--badroff.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/badroff.c b/badroff.c
index 6a630ed..3d96fc7 100644
--- a/badroff.c
+++ b/badroff.c
@@ -160,16 +160,13 @@ char* lineset(char* txt){
bool done = true; // if stays true, all strings are complete
llnode* orig = tail;
do { // check every string
- if (tail->end) goto iter;
- if (tail->str[i] == 0){
- tail->end = true;
- goto iter;
- } // ignore strings that have already finished
- done = false;
- if (tail->str[i] != ' ')
- valid = false;
- // doesn't break because tail needs to return to orig
- iter:
+ if (tail->str[i] == 0) tail->end = true;
+ // ignore strings that have already finished
+ else if (!tail->end){
+ done = false;
+ if (tail->str[i] != ' ') valid = false;
+ // can't break here because tail needs to return to orig
+ }
tail = tail->next;
} while (tail != orig);
if (valid) brk = i;