]> git.kaiwu.me - klib.git/commitdiff
Simplify 8d8d1a19f0c69b53d5ed8d9f6592dfa4b91c23f3 code changes
authorJohn Marshall <jm18@sanger.ac.uk>
Thu, 13 Nov 2014 11:57:56 +0000 (11:57 +0000)
committerJohn Marshall <jm18@sanger.ac.uk>
Thu, 13 Nov 2014 11:57:56 +0000 (11:57 +0000)
kseq.h

diff --git a/kseq.h b/kseq.h
index 772cdee40aabe1863697c076bab05087c2181b8f..4d8a46e1966264bc24299e89859d1156d51ffb0a 100644 (file)
--- a/kseq.h
+++ b/kseq.h
@@ -70,8 +70,7 @@
                if (ks->begin >= ks->end) {                                                     \
                        ks->begin = 0;                                                                  \
                        ks->end = __read(ks->f, ks->buf, __bufsize);    \
-                       if (ks->end == 0) ks->is_eof = 1;               \
-                       if (ks->end == 0) return -1;                                    \
+                       if (ks->end == 0) { ks->is_eof = 1; return -1;} \
                }                                                                                                       \
                return (int)ks->buf[ks->begin++];                                       \
        }
@@ -100,8 +99,7 @@ typedef struct __kstring_t {
                                if (!ks->is_eof) {                                                                              \
                                        ks->begin = 0;                                                                          \
                                        ks->end = __read(ks->f, ks->buf, __bufsize);            \
-                                       if (ks->end == 0) ks->is_eof = 1;                       \
-                                       if (ks->end == 0) break;                                                        \
+                                       if (ks->end == 0) { ks->is_eof = 1; break; }            \
                                } else break;                                                                                   \
                        }                                                                                                                       \
                        if (delimiter == KS_SEP_LINE) { \