From b362acf575424bcfea6444ce6cbfe3c3aa3f1192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Fri, 2 Apr 2021 13:34:33 +0200 Subject: git-send-email: replace "map" in void context with "for" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 8fd5bb7f44b (git send-email: add --annotate option, 2008-11-11) to be a for-loop instead. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- git-send-email.perl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git-send-email.perl') diff --git a/git-send-email.perl b/git-send-email.perl index f5bbf1647e..6893c8e580 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -217,12 +217,12 @@ sub do_edit { $editor = Git::command_oneline('var', 'GIT_EDITOR'); } if (defined($multiedit) && !$multiedit) { - map { + for (@_) { system('sh', '-c', $editor.' "$@"', $editor, $_); if (($? & 127) || ($? >> 8)) { die(__("the editor exited uncleanly, aborting everything")); } - } @_; + } } else { system('sh', '-c', $editor.' "$@"', $editor, @_); if (($? & 127) || ($? >> 8)) { -- cgit v1.2.3