From f7d469bb00c024ace34465890a85a99db030a730 Mon Sep 17 00:00:00 2001 From: Nick Krichevsky Date: Sun, 2 Sep 2018 22:57:19 -0400 Subject: [PATCH] Refactor print_rtt detection --- client/http_client.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/client/http_client.c b/client/http_client.c index 921c387..9025ea0 100644 --- a/client/http_client.c +++ b/client/http_client.c @@ -8,16 +8,11 @@ #include int main(int argc, char* argv[]) { - bool print_rtt = false; if (argc == 1) { printf("%s", USAGE_STRING); return 1; } - for (int i = 0; i < argc; i++) { - if (strcmp(argv[i], RTT_FLAG) == 0) { - print_rtt = true; - } - } + bool print_rtt = strcmp(argv[1], RTT_FLAG) == 0; if ((print_rtt && argc != 4) || (!print_rtt && argc != 3)) { printf("%s", USAGE_STRING); return 1;