Re: Fast NSArray compare
Re: Fast NSArray compare
- Subject: Re: Fast NSArray compare
- From: Varun Chandramohan <email@hidden>
- Date: Tue, 15 Apr 2014 22:31:15 +0000
- Thread-topic: Fast NSArray compare
To summarise what was discussed,
- I think the folder hierarchy problem is easily solvable as I always
traverse from top of the tree. If an entry for one of the folders is found
in my set I stop the traversal to lower leaves of the tree.
- I would be using NSSet to store my “restrict list”. However I will be
using file names instead of resource identifier object because I need to
preserve this across reboots. However I could always extract the resource
identifier object for these NSURL objects and do the comparison. There is
always a possibility that one of the files stored in “restricted list”
could be removed or changed automatically by user or program. If this
happens, I am holding a useless value that is no longer present in file
system. This is not a big issue as I see other than wasteful entry in the
set. Upon application restart when reading from the file which stored the
restricted list, I could do a file existence check for all entries in the
restricted set.
- I will be converting the NSSet to NSArray and save it in file. I read
the array as NSSet when the application starts.
Is there something else I am missing?
Regards,
Varun
On 16/04/2014 4:17 am, "Gary L. Wade" <email@hidden> wrote:
>Also, if your folder hierarchy, traversal code, and checks can deal well
>with it, you¹ll get better performance by short-circuiting based on upper
>directory checks.
>
>For example, if you know you¹re in /Downloads, don¹t compare against
>/Documents/AboutUs.pdf. Just use the /Documents set of file objects when
>you¹re in /Documents.
>--
>Gary L. Wade
>http://www.garywade.com/
>
>
>
>
>
>_______________________________________________
>
>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:
>tok.com
>
>This email sent to email@hidden
_______________________________________________
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