Subject: | wrong using splice |
I see in code this path twice
my $i = @{$heap->{sidecar_ring}};
while ($i--) {
next unless $heap->{sidecar_ring}[$i]->ID() == $wheel_id;
splice(@{$heap->{sidecar_ring}}, 1, 1);
last;
}
I think that you want to write
splice(@{$heap->{sidecar_ring}}, $i, 1);