summaryrefslogtreecommitdiff
path: root/5/part2_fast.c
diff options
context:
space:
mode:
Diffstat (limited to '5/part2_fast.c')
-rw-r--r--5/part2_fast.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/5/part2_fast.c b/5/part2_fast.c
index 9c4753e..2334390 100644
--- a/5/part2_fast.c
+++ b/5/part2_fast.c
@@ -59,13 +59,12 @@ int missing_seat_id(const char *filename)
int max = 0;
while (fgets(buffer, 16, file)) {
int tmp = seat_id(buffer);
- if (tmp > max) {
- max = tmp;
- }
-
if (tmp < min) {
min = tmp;
}
+ else if (tmp > max) {
+ max = tmp;
+ }
table[tmp] = 1;
}