Less verbose checking.
This commit is contained in:
parent
df3a06206b
commit
1129f3fdc5
@ -85,10 +85,7 @@ sub clear {
|
||||
# clear all the references in $self. Yes, this is inefficient, but
|
||||
# the alternative is reassigning self... so no, delete them all.
|
||||
foreach my $key (keys %{$self}) {
|
||||
if(!defined($self -> {$key})) {
|
||||
print STDERR "System::clear attempting to clear value for $key when undef?\n";
|
||||
next;
|
||||
}
|
||||
next if(!defined($self -> {$key})); # skip undefined refs
|
||||
|
||||
$self -> {$key} -> clear() if($self -> {$key} -> can("clear"));
|
||||
delete $self -> {$key};
|
||||
|
Loading…
x
Reference in New Issue
Block a user