@matheusbsbs / matheus-bagliano / commits / 68ce93307f
Fork 0

send-email: Cleanup { style

As Jakub Narebski pointed out on the list, Perl code usually prefers sub func { } over sub func { } git-send-email.perl is somewhat inconsistent in its style, with 23 subroutines using the first style and 6 using the second. Convert the few odd subroutines so that the code matches normal Perl style. Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brian Gernhardt committed Apr 10, 2010 at 10:53 UTC 68ce93307fcc0364816664114a71c58f60bbad94
1 file changed +6 -12
git-send-email.perl
+6 -12
@@ -752,8 +752,7 @@ sub extract_valid_address {
752 # We'll setup a template for the message id, using the "from" address:
753
754 my ($message_id_stamp, $message_id_serial);
755 -sub make_message_id
756 -{
755 +sub make_message_id {
756 my $uniq;
757 if (!defined $message_id_stamp) {
758 $message_id_stamp = sprintf("%s-%s", time, $$);
@@ -808,8 +807,7 @@ sub is_rfc2047_quoted {
807 }
808
809 # use the simplest quoting being able to handle the recipient
811 -sub sanitize_address
812 -{
810 +sub sanitize_address {
811 my ($recipient) = @_;
812 my ($recipient_name, $recipient_addr) = ($recipient =~ /^(.*?)\s*(<.*)/);
813
@@ -854,8 +852,7 @@ sub sanitize_address
852 # This maildomain*() code is based on ideas in Perl library Test::Reporter
853 # /usr/share/perl5/Test/Reporter/Mail/Util.pm ==> sub _maildomain ()
854
857 -sub maildomain_net
858 -{
855 +sub maildomain_net {
856 my $maildomain;
857
858 if (eval { require Net::Domain; 1 }) {
@@ -867,8 +864,7 @@ sub maildomain_net
864 return $maildomain;
865 }
866
870 -sub maildomain_mta
871 -{
867 +sub maildomain_mta {
868 my $maildomain;
869
870 if (eval { require Net::SMTP; 1 }) {
@@ -889,8 +885,7 @@ sub maildomain_mta
885 return $maildomain;
886 }
887
892 -sub maildomain
893 -{
888 +sub maildomain {
889 return maildomain_net() || maildomain_mta() || $mail_domain_default;
890 }
891
@@ -898,8 +893,7 @@ sub maildomain
893 # In actuality, the whole program dies when there
894 # is an error sending a message.
895
901 -sub send_message
902 -{
896 +sub send_message {
897 my @recipients = unique_email_list(@to);
898 @cc = (grep { my $cc = extract_valid_address($_);
899 not grep { $cc eq $_ } @recipients