do not remove an element while splicing

This commit is contained in:
Doug Bell 2011-04-11 15:20:18 -05:00
parent 3a2b28eb76
commit 332a734288
2 changed files with 11 additions and 3 deletions

View file

@ -76,7 +76,7 @@ The numeric index. 0 is the first object.
sub addObjectAt {
my ( $self, $object, $position ) = @_;
splice @{$self->objects}, $position, 1, $object;
splice @{$self->objects}, $position, 0, $object;
return $object;
}