Re: BOOL array
Re: BOOL array
- Subject: Re: BOOL array
- From: "Michael Ash" <email@hidden>
- Date: Thu, 11 Sep 2008 11:25:14 -0400
On Wed, Sep 10, 2008 at 12:28 PM, Shawn Erickson <email@hidden> wrote:
> On Wed, Sep 10, 2008 at 9:18 AM, Joel Norvell <email@hidden> wrote:
>> OK. I think I've got it. One could use an increasing sequence of integers, letting evenness and oddness determine the boolean state at any index. That would save a huge amount of "overhead" in this case!
>
> You only need to store the "index" of all the "ones" not need for
> even/odd business. You then walk the index set picking out the ones
> and marking down zeros for those indexes not in the set, etc.
>
> Of course the bit vector that someone suggested earlier is likely a
> better tool for this.
They are, in fact, essentially equivalent. The only difference in
terms of functionality is that CFBitVector can give you the index of
the top zero bit as well as the top one bit, whereas an NSIndexSet is
effectively always infinitely long. But if you don't care about
length, or you store it elsewhere, they provide identical
functionality with different APIs and implementations.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden