• 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: Optimizing a loop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Optimizing a loop


  • Subject: Re: Optimizing a loop
  • From: Vincent Habchi <email@hidden>
  • Date: Tue, 19 Jul 2011 15:55:14 +0200

> Someone told me to look into -enumerateKeysAndObjectsWithOptions:usingBlock: (using NSEnumerationConcurrent) Would that be a better way? If so, I haven't seen this used before - how could I apply it?

You can try to use that, but, basically, it is the same problem: you enumerate all entries in your dictionary and compute your string distance for each, which is cumbersome. The algorithm I propose you is way faster, because you don't have to recompute this distance each time you search. But, once again, the crude way to compute a hash code might not suit your needs.

Vincent_______________________________________________

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

  • Follow-Ups:
    • Re: Optimizing a loop
      • From: "Eric E. Dolecki" <email@hidden>
References: 
 >Optimizing a loop (From: "Eric E. Dolecki" <email@hidden>)
 >Re: Optimizing a loop (From: Vincent Habchi <email@hidden>)
 >Re: Optimizing a loop (From: "Eric E. Dolecki" <email@hidden>)
 >Re: Optimizing a loop (From: Vincent Habchi <email@hidden>)
 >Re: Optimizing a loop (From: "Eric E. Dolecki" <email@hidden>)

  • Prev by Date: Re: Optimizing a loop
  • Next by Date: Re: Optimizing a loop
  • Previous by thread: Re: Optimizing a loop
  • Next by thread: Re: Optimizing a loop
  • Index(es):
    • Date
    • Thread