Less verbose checking.

This commit is contained in:
Chris 2012-06-15 13:39:25 +01:00
parent df3a06206b
commit 1129f3fdc5

View File

@ -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};