Re: [PATCH 1/3] send-email: Don't use FQDNs without a '.'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Brian Gernhardt <brian@xxxxxxxxxxxxxxxxxxxxx> writes:

>  		$maildomain = $domain
> -			unless $^O eq 'darwin' && $domain =~ /\.local$/;
> +			unless $^O eq 'darwin' && $domain =~ /\.local$/
> +				or $domain !~ /\./;

It would become *much* easier to read if we stop using the statement
modifier, and write it in a more straightforward way:

	unless (($^O eq 'darwin' && $domain =~ /\.local$/)
        	|| $domain !~ /\./) {
                $maildomain = $domain;
	}

as the condition seems to have grown large enough to exceed "by the way
don't do this under this narrow condition", which is what statement
modifiers are designed to be used.  Also mixing && and or that have
different precedence taxes readers' brainpower unnecessarily.

I also think that this particular exception logic should probably be in a
separate helper function that is called from the two places.

Jari, you are the last person who touched code around this area.  What do
you think?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]