| Next | Program Repair Shop | 54 |
You'd think this would be simple
Since it's basically $O{$self} = []
Here's the original code:
61 sub delete_all_observers {
62 my ( $item ) = @_;
65 my $num_removed = 0;
66 return $num_removed unless ( ref $O{ $item } eq 'ARRAY' );
67 $num_removed = scalar @{ $O{ $item } };
68 $O{ $item } = [];
69 return $num_removed;
70 }
What's line 66 for?
And if it's not an array, what's going to happen on line 67?
Get rid of it
If this were up to me, I would get rid of the return value too
Who cares how many observers there were before we blew them all away?
If you really want to know, call ->get_observers before you kill them.
Oh, well.
| Next | ![]() |
Copyright © 2006 M. J. Dominus |