From 17b3ea471d3e4a5df18f36d913c20d00adaf62c9 Mon Sep 17 00:00:00 2001 From: Amirali Amirifar Date: Tue, 13 Oct 2020 05:59:01 +0330 Subject: [PATCH] Remove duplicate definition of `args` vector. (#609) * Remove duplicate definition of `args` vector. Removed duplicate definition of the variable `args` which could be defined in the first line rather than defining once in the if scope and once in the main function. --- drogon_ctl/main.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drogon_ctl/main.cc b/drogon_ctl/main.cc index beca6bec..b4f3c4d3 100755 --- a/drogon_ctl/main.cc +++ b/drogon_ctl/main.cc @@ -1,7 +1,7 @@ /** * - * main.cc - * An Tao + * @file main.cc + * @author An Tao * * Copyright 2018, An Tao. All rights reserved. * https://github.com/an-tao/drogon @@ -19,13 +19,13 @@ int main(int argc, char *argv[]) { + std::vector args; if (argc < 2) { - std::vector args = {"help"}; + args = {"help"}; exeCommand(args); return 0; } - std::vector args; for (int i = 1; i < argc; ++i) { args.push_back(argv[i]);