"Harry Ohlsen" <harryo / qiqsolutions.com> schrieb im Newsbeitrag
news:40A8445E.5020403 / qiqsolutions.com...

> The first version in your latest e-mail didn't work for me.  It just
gave me the complete array every time.
>
> I think it's because when n[i] is zero, that's not the same as false,
hence the "if" always succeeds.
>
> You just need to change that line to
>
>         subset << elem if (n[i] == 1)
>
> The second version worked fine.

Yeah, I noticed the error but apparently didn't recheck the first version.
You're right of course.

> I like all of your clean-ups.

Thank you!

>  I wonder whether re-coding in C would increase performance?

Dunno.  I didn't write a ruby extension yet but I heard it's pretty easy.
:-)

> Anyway, it might be worth creating an RCR to have this added to
Enumerable.

Maybe.  The crucial point is, is this general enough to place it there?
Well, the vote might show it.

Regards

    robert