All pastes #455859 Raw Edit

Someone

public text v1 · immutable
#455859 ·published 2007-04-24 14:27 UTC
rendered paste body
sub _subtract {
    my( $this, $set, $new ) = @_;

    my $i = 0;
    my @remove;
    foreach my $known (@{$this->{$set}}) {
        if( $new->covers( $known )) {
            # remove anything covered by the new subscription
            unshift(@remove, $i);
        }
        $i++;
    }
    foreach $i (@remove) {
        splice(@{$this->{$set}}, $i, 1);
    }
}