• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSIndexSet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSIndexSet


  • Subject: Re: NSIndexSet
  • From: Jon Hull <email@hidden>
  • Date: Sat, 29 Nov 2003 19:59:27 -0800

On Nov 29, 2003, at 6:30 PM, Matthew Johnson wrote:

I am implementing a category on NSIndexSet that includes a method -
(BOOL)intersectsIndexes:(NSIndexSet *)indexSet. The implementation of
this will have to loop through one of the index sets and check for
intersection using containsIndex and intersectsIndexesInRange. I am
wondering whether it would generally be quicker to loop through the
smaller index set or perform the intersection tests on the smaller
index set. Opinions?

Why not just use the methods firstIndex and lastIndex on the both sets
then use the larger firstIndex and smaller lastIndex to make an
NSRange, then return intersectsIndexesInRange?

OOPS, disregard that last message just looked at the docs more carefully.

I would suggest only checking in the NSRange mentioned in my last message, but beyond that I doubt that there is a huge speed difference.

Thanks,
Jon
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSIndexSet
      • From: Matthew Johnson <email@hidden>
References: 
 >NSIndexSet (From: Matthew Johnson <email@hidden>)
 >Re: NSIndexSet (From: Jon Hull <email@hidden>)

  • Prev by Date: Re: Getting NSTextField from NSWindow firstResponder
  • Next by Date: Re: rounding a float
  • Previous by thread: Re: NSIndexSet
  • Next by thread: Re: NSIndexSet
  • Index(es):
    • Date
    • Thread