diff options
-rw-r--r-- | sd.c | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -17,7 +17,7 @@ int main(int argc, char* argv[]) { {"file", required_argument, NULL, 'f'}, {"verbose", no_argument, NULL, 'v'} }; - while (1) { + while (true) { int option_index = 0; int c = getopt_long(argc, argv, "f:v", long_options, &option_index); if (c == -1) break; @@ -86,15 +86,9 @@ int main(int argc, char* argv[]) { /* Read user input */ b = getchar(); - if (b == 'y') { - w >>= 1; - } - else if (b == 'n') { - w <<= 3; - } - else { - break; - } + if (b == 'y') w >>= 1; + else if (b == 'n') w <<= 3; + else break; /* Update segment tree and database */ update(i, w, 0, N - 1, 1); |