git: make was_alias and done_help non-static
'was_alias' variable does not need to store it's value on each iteration in the loop; this variable gets assigned the result of run_argv() every time in the loop before being used. 'done_help' variable does not need to be static variable too if we move it out the loop. Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com> Helped-by: Eric Sunshine <sunshine@sunshineco.com> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Alexander Kuleshov committed
Mar 2, 2015 at 18:02 UTC
8fa7975b076ae039f63286601f48e64115e2aba7
1 file changed
+2
-3
git.c
+2
-3
@@ -618,6 +618,7 @@ int main(int argc, char **av)
618
{
619
const char **argv = (const char **) av;
620
const char *cmd;
621
+ int done_help = 0;
622
623
startup_info = &git_startup_info;
624
@@ -680,9 +681,7 @@ int main(int argc, char **av)
681
setup_path();
682
683
while (1) {
683
- static int done_help = 0;
684
- static int was_alias = 0;
685
- was_alias = run_argv(&argc, &argv);
684
+ int was_alias = run_argv(&argc, &argv);
685
if (errno != ENOENT)
686
break;
687
if (was_alias) {