From: John Marshall Date: Thu, 13 Nov 2014 11:57:56 +0000 (+0000) Subject: Simplify 8d8d1a19f0c69b53d5ed8d9f6592dfa4b91c23f3 code changes X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=fa0868154277b603d656ce0c32be8e5ac94a1029;p=klib.git Simplify 8d8d1a19f0c69b53d5ed8d9f6592dfa4b91c23f3 code changes --- diff --git a/kseq.h b/kseq.h index 772cdee..4d8a46e 100644 --- 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) { \