Skip to content

Commit b362acf

Browse files
avargitster
authored andcommitted
git-send-email: replace "map" in void context with "for"
While using "map" instead of "for" or "map" instead of "grep" and vice-versa makes for interesting trivia questions when interviewing Perl programmers, it doesn't make for very readable code. Let's refactor this loop initially added in 8fd5bb7 (git send-email: add --annotate option, 2008-11-11) to be a for-loop instead. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a65ce7f commit b362acf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

git-send-email.perl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,12 @@ sub do_edit {
217217
$editor = Git::command_oneline('var', 'GIT_EDITOR');
218218
}
219219
if (defined($multiedit) && !$multiedit) {
220-
map {
220+
for (@_) {
221221
system('sh', '-c', $editor.' "$@"', $editor, $_);
222222
if (($? & 127) || ($? >> 8)) {
223223
die(__("the editor exited uncleanly, aborting everything"));
224224
}
225-
} @_;
225+
}
226226
} else {
227227
system('sh', '-c', $editor.' "$@"', $editor, @_);
228228
if (($? & 127) || ($? >> 8)) {

0 commit comments

Comments
 (0)