Shorten/clarify Connection and Transaction notes()
Update Qpsmtpd::Connection::notes() and Qpsmtpd::Transaction::notes() with clearer, more brief syntax. A previous patch used seemingly better syntax, but did not evaluate the size of @_ in order to distinguish between a call to notes('arg1',undef) and notes('arg1'). This corrects this issue, and adds a comment to that effect.
This commit is contained in:
parent
fa91764f88
commit
96aa5ba171
@ -108,10 +108,10 @@ sub hello_host {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub notes {
|
sub notes {
|
||||||
my $self = shift;
|
my ($self,$key) = (shift,shift);
|
||||||
my $key = shift;
|
# Check for any additional arguments passed by the caller -- including undef
|
||||||
@_ and $self->{_notes}->{$key} = shift;
|
return $self->{_notes}->{$key} unless @_;
|
||||||
$self->{_notes}->{$key};
|
return $self->{_notes}->{$key} = shift;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub reset {
|
sub reset {
|
||||||
|
@ -61,11 +61,10 @@ sub header {
|
|||||||
#}
|
#}
|
||||||
|
|
||||||
sub notes {
|
sub notes {
|
||||||
my $self = shift;
|
my ($self,$key) = (shift,shift);
|
||||||
my $key = shift;
|
# Check for any additional arguments passed by the caller -- including undef
|
||||||
@_ and $self->{_notes}->{$key} = shift;
|
return $self->{_notes}->{$key} unless @_;
|
||||||
#warn Data::Dumper->Dump([\$self->{_notes}], [qw(notes)]);
|
return $self->{_notes}->{$key} = shift;
|
||||||
$self->{_notes}->{$key};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub set_body_start {
|
sub set_body_start {
|
||||||
|
Loading…
Reference in New Issue
Block a user