]> diplodocus.org Git - nmh/commitdiff
Don't `else' after return. Simplify control flow.
authorRalph Corderoy <ralph@inputplus.co.uk>
Thu, 20 Oct 2016 22:20:17 +0000 (23:20 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Thu, 20 Oct 2016 22:34:05 +0000 (23:34 +0100)
sbr/m_getfld.c

index 2e1ed99..1a1411e 100644 (file)
@@ -463,19 +463,17 @@ static int
 Peek (m_getfld_state_t s) {
     if (s->end - s->readpos < 1  &&  read_more (s) == 0) {
         return EOF;
 Peek (m_getfld_state_t s) {
     if (s->end - s->readpos < 1  &&  read_more (s) == 0) {
         return EOF;
-    } else {
-        return s->readpos < s->end  ?  (unsigned char) *s->readpos  :  EOF;
     }
     }
+    return s->readpos < s->end  ?  (unsigned char) *s->readpos  :  EOF;
 }
 
 static int
 Ungetc (int c, m_getfld_state_t s) {
     if (s->readpos == s->msg_buf) {
        return EOF;
 }
 
 static int
 Ungetc (int c, m_getfld_state_t s) {
     if (s->readpos == s->msg_buf) {
        return EOF;
-    } else {
-       --s->bytes_read;
-       return *--s->readpos = (unsigned char) c;
     }
     }
+    --s->bytes_read;
+    return *--s->readpos = (unsigned char) c;
 }
 
 
 }
 
 
@@ -589,7 +587,8 @@ m_getfld (m_getfld_state_t *gstate, char name[NAMESZ], char *buf, int *bufsz,
                *bufsz = --s->bytes_read;  /* == n - 1 */
                leave_getfld (s);
                return s->state = BODY;
                *bufsz = --s->bytes_read;  /* == n - 1 */
                leave_getfld (s);
                return s->state = BODY;
-           } else if (max <= n) {
+           }
+            if (max <= n) {
                /* By design, the loop above discards the last character
                    it had read.  It's in c, use it. */
                *cp++ = c;
                /* By design, the loop above discards the last character
                    it had read.  It's in c, use it. */
                *cp++ = c;