diff options
Diffstat (limited to 'lib/Data/MultiValued')
-rw-r--r-- | lib/Data/MultiValued/RangeContainer.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Data/MultiValued/RangeContainer.pm b/lib/Data/MultiValued/RangeContainer.pm index e4c459f..69dcc38 100644 --- a/lib/Data/MultiValued/RangeContainer.pm +++ b/lib/Data/MultiValued/RangeContainer.pm @@ -160,13 +160,14 @@ sub _splice_slot { # by costruction, the first and the last may have to be split, all # others must be removed - my $first_to_replace = $overlap->[0], - my $last_to_replace = $overlap->[-1], + my $first_to_replace; my $how_many = @$overlap; my @replacement = $new ? ($new) : (); if ($how_many > 0) { # we have to splice + $first_to_replace = $overlap->[0]; + my $last_to_replace = $overlap->[-1]; my $first = $self->_storage->[$first_to_replace]; my $last = $self->_storage->[$last_to_replace]; @@ -187,6 +188,9 @@ sub _splice_slot { } } } + else { + $first_to_replace = $before->[-1]+1; + } splice @{$self->_storage}, $first_to_replace,$how_many, |