do not remove an element while splicing
This commit is contained in:
parent
3a2b28eb76
commit
332a734288
2 changed files with 11 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue