{"thread":{"id":"10219","subject":"[PATCH 2/2] git add -i: Remove unused variables","startedAt":"2007-10-09T19:34:17Z","lastAt":"2007-10-09T19:34:17Z","messageCount":1,"participants":["Jean-Luc Herren"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"55299","messageId":"470BD7B9.4080206@gmx.ch","threadId":"10219","inReplyTo":null,"subject":"[PATCH 2/2] git add -i: Remove unused variables","fromName":"Jean-Luc Herren","fromEmail":"jlh@gmx.ch","sentAt":"2007-10-09T19:34:17Z","receivedAt":"2007-10-09T19:34:17Z","isPatch":true,"sender":{"key":"jlh@gmx.ch","avatar":null},"body":"\nSigned-off-by: Jean-Luc Herren <jlh@gmx.ch>\n---\n\nMaybe it's a matter of opinion which of the following is better.\nThe later makes it clearer that some return values are being\nthrown away, but some people might consider it noise.  I chose the\nfirst one for now.\n\nmy ($a, $b) = function(...)\nmy ($a, $b, undef, undef) = function(...)\n\n git-add--interactive.perl |   16 ++++++----------\n 1 files changed, 6 insertions(+), 10 deletions(-)\n\ndiff --git a/git-add--interactive.perl b/git-add--interactive.perl\nindex 15b3f5b..ac598f8 100755\n--- a/git-add--interactive.perl\n+++ b/git-add--interactive.perl\n@@ -374,9 +374,8 @@ sub split_hunk {\n \t# it can be split, but we would need to take care of\n \t# overlaps later.\n \n-\tmy ($o_ofs, $o_cnt, $n_ofs, $n_cnt) = parse_hunk_header($text->[0]);\n+\tmy ($o_ofs, undef, $n_ofs) = parse_hunk_header($text->[0]);\n \tmy $hunk_start = 1;\n-\tmy $next_hunk_start;\n \n       OUTER:\n \twhile (1) {\n@@ -443,8 +442,8 @@ sub split_hunk {\n \tfor my $hunk (@split) {\n \t\t$o_ofs = $hunk->{OLD};\n \t\t$n_ofs = $hunk->{NEW};\n-\t\t$o_cnt = $hunk->{OCNT};\n-\t\t$n_cnt = $hunk->{NCNT};\n+\t\tmy $o_cnt = $hunk->{OCNT};\n+\t\tmy $n_cnt = $hunk->{NCNT};\n \n \t\tmy $head = (\"@@ -$o_ofs\" .\n \t\t\t    (($o_cnt != 1) ? \",$o_cnt\" : '') .\n@@ -459,7 +458,7 @@ sub split_hunk {\n sub find_last_o_ctx {\n \tmy ($it) = @_;\n \tmy $text = $it->{TEXT};\n-\tmy ($o_ofs, $o_cnt, $n_ofs, $n_cnt) = parse_hunk_header($text->[0]);\n+\tmy ($o_ofs, $o_cnt) = parse_hunk_header($text->[0]);\n \tmy $i = @{$text};\n \tmy $last_o_ctx = $o_ofs + $o_cnt;\n \twhile (0 < --$i) {\n@@ -531,8 +530,7 @@ sub coalesce_overlapping_hunks {\n \n \tfor (grep { $_->{USE} } @in) {\n \t\tmy $text = $_->{TEXT};\n-\t\tmy ($o_ofs, $o_cnt, $n_ofs, $n_cnt) =\n-\t\t    parse_hunk_header($text->[0]);\n+\t\tmy ($o_ofs) = parse_hunk_header($text->[0]);\n \t\tif (defined $last_o_ctx &&\n \t\t    $o_ofs <= $last_o_ctx) {\n \t\t\tmerge_hunk($out[-1], $_);\n@@ -699,7 +697,7 @@ sub patch_update_cmd {\n \n \t@hunk = coalesce_overlapping_hunks(@hunk);\n \n-\tmy ($o_lofs, $n_lofs) = (0, 0);\n+\tmy $n_lofs = 0;\n \tmy @result = ();\n \tfor (@hunk) {\n \t\tmy $text = $_->{TEXT};\n@@ -806,8 +804,6 @@ sub main_loop {\n \t}\n }\n \n-my @z;\n-\n refresh();\n status_cmd();\n main_loop();\n-- \n1.5.3.4\n"}]}