diff options
author | Holden Rohrer <hr@hrhr.dev> | 2020-05-18 01:24:08 -0400 |
---|---|---|
committer | Holden Rohrer <hr@hrhr.dev> | 2020-05-18 01:24:31 -0400 |
commit | 38c700a0915aa6cf6b2111f6ae72c584f16d4826 (patch) | |
tree | f2d1659ddbdf47c75ecd4588840e73b805c9f4cf | |
parent | 9cb31de0aef51bce0c753e3c64637c106e846d36 (diff) |
Removed an unnecessary goto and 3 lines
-rw-r--r-- | badroff.c | 17 |
1 files changed, 7 insertions, 10 deletions
@@ -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; |