[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Hashing, and NSDictionaries
From: |
Stephen Brandon |
Subject: |
Re: Hashing, and NSDictionaries |
Date: |
Tue, 12 Mar 2002 20:35:30 +0000 |
Aha! (lightbulb goes on). Thanks for the explanation - that makes a lot of
sense.
The issue for me is to do with "MKPart" objects, which hold very long lists
of MKNotes. Each MKNote has a whole lot of parameters.
If a MKPart is copied, all the MKNotes are copied too (deep copy), which
means that a proper comparison between 2 parts has to go through and check
all the notes in turn.
Hmmm... in this case, when there aren't likely to be that many parts, is the
best thing to do to provide a faster and less accurate hash function, and
then a more intelligent isEqual: method which is able to short-circuit as
soon as it finds a difference between 2 parts?
My mistake was to assume that creating a hash would provide an absolute
comparison - for these object, a "near enough" but very fast hash will do I
think.
Cheers,
Stephen Brandon