Skip to content

Commit dd305c8

Browse files
MadCoderJunio C Hamano
authored andcommitted
use name[len] in switch directly, instead of creating a shadowed variable.
builtin-apply.c defines a local variable 'c' which is used only once and then later gets shadowed by another instance of 'c'. Signed-off-by: Pierre Habouzit <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 599f8d6 commit dd305c8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

builtin-apply.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,9 +606,7 @@ static char *git_header_name(char *line, int llen)
606606
* form.
607607
*/
608608
for (len = 0 ; ; len++) {
609-
char c = name[len];
610-
611-
switch (c) {
609+
switch (name[len]) {
612610
default:
613611
continue;
614612
case '\n':

0 commit comments

Comments
 (0)