Re: [PATCH] unrecognized_commands: better log messages
[email protected] (Charlie Brady) Mon, 4 Jun 2012 22:35:46 -0400 (EDT)
| Newsgroups | perl.qpsmtpd |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 4 Jun 2012, Matt Simerson wrote:
> + my $count = $self->connection->notes('unrec_cmd_count') || 0;
> + $self->connection->notes('unrec_cmd_count', ++$count );
>
> Which does increment correctly.
>
> This also works (note the parens), which is how it was done before.
>
> + my $count = ($self->connection->notes('unrec_cmd_count') || 0) + 1;
> + $self->connection->notes('unrec_cmd_count', $count );
>
> Which one is easier to read and maintain? Both seem equal to the task.
I would prefer:
my $count = $self->connection->notes('unrec_cmd_count') || 0;
$self->connection->notes('unrec_cmd_count', $count + 1);
Do you have a reason for the unconventional whitespace formatting?