Skip to content

Commit 8fa7975

Browse files
0xAXgitster
authored andcommitted
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 <[email protected]> Helped-by: Eric Sunshine <[email protected]> Helped-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9874fca commit 8fa7975

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

git.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ int main(int argc, char **av)
618618
{
619619
const char **argv = (const char **) av;
620620
const char *cmd;
621+
int done_help = 0;
621622

622623
startup_info = &git_startup_info;
623624

@@ -680,9 +681,7 @@ int main(int argc, char **av)
680681
setup_path();
681682

682683
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);
686685
if (errno != ENOENT)
687686
break;
688687
if (was_alias) {

0 commit comments

Comments
 (0)