diff options
author | Anthony Wang | 2022-10-20 00:37:37 -0400 |
---|---|---|
committer | Anthony Wang | 2022-10-20 00:37:37 -0400 |
commit | a73b0c48a60bb96306e9c5ef7351200cb04ee03d (patch) | |
tree | 35865ccdbeb53aa24403723f6d649527826565f4 | |
parent | 6ea6f9c1c60c7025e0b7bdc95a5d5aa395eedfbc (diff) |
Code cleanup
-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); |