diff options
author | Gianni Ceccarelli <dakkar@thenautilus.net> | 2011-11-14 14:17:22 +0000 |
---|---|---|
committer | Gianni Ceccarelli <dakkar@thenautilus.net> | 2011-11-14 14:17:22 +0000 |
commit | bb0870231cd8f7caee0c6ccf6b455919f9e0a79b (patch) | |
tree | 1edf571226d5c767dc236e185064642fcd1ba383 /lib/Data/MultiValued | |
parent | Build results of 467399a (on master) (diff) | |
parent | fix inserting range w/o overlap (diff) | |
download | data-multivalued-bb0870231cd8f7caee0c6ccf6b455919f9e0a79b.tar.gz data-multivalued-bb0870231cd8f7caee0c6ccf6b455919f9e0a79b.tar.bz2 data-multivalued-bb0870231cd8f7caee0c6ccf6b455919f9e0a79b.zip |
Build results of dd15e2e (on master)
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, |