in reply to Re: Re: round-robin on varying sequence
in thread round-robin on varying sequence

Agreed, splice was the wrong idea. How do you like this one?

sub remove_items { $index -= grep { $_ < $index } @_; delete @items[@_]; @items = grep {defined} @items; }

I dislike the use of broader scoped $index and @items in this.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: Re: Re: round-robin on varying sequence
by BrowserUk (Patriarch) on Sep 07, 2002 at 08:02 UTC

    I think, and I emphasis, I think, that your solution is different to the original.

    Unless my reading of the Q is wrong, and my benchmark below is crap, in the original the passed array is and array of values to be removed.

    In yours, you seem to be expecting an array of indices?


    Well It's better than the Abottoire, but Yorkshire!