| ☞ | Program
Repair Shop ![]() |
49 |
sub get_observers {
my $self = shift;
my @o = $self->_class_observers;
push @o, @{$self->direct_observers} if ref $self;
return _uniq(@o);
}
We can get rid of the test:
sub get_observers {
my $self = shift;
my @o = ($self->_class_observers,
@{$self->direct_observers});
return _uniq(@o);
}
For classes, the call to ->direct_observers is redundant
But the _uniq() call will cover this up
Which do you think is better?
| ☞ | ![]() |
☞ |