Skip to content

Commit 7a6a9c2

Browse files
committed
Fixed fast-io.hpp.
1 parent d266b4c commit 7a6a9c2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/alfred/config/fast-io.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ class FastIO {
1010
char *buf, *p1, *p2;
1111
char *obuf, *op;
1212

13-
inline void flush_output(void) {
13+
inline void flush_output() {
14+
size_t len = size_t(op - obuf);
1415
fwrite(obuf, 1, len, stdout), op = obuf;
1516
}
1617

@@ -19,7 +20,8 @@ class FastIO {
1920
if (p1 == p2) {
2021
p2 = (p1 = buf) + fread(buf, 1, chunk, stdin);
2122
if (p1 == p2) return EOF;
22-
} else return *p1++;
23+
}
24+
return *p1++;
2325
}
2426
inline void pc(char c) {
2527
if (op == obuf + chunk) flush_output();

0 commit comments

Comments
 (0)