gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: isEqual: and hash in NSDate


From: Jeremy Bettis
Subject: Re: isEqual: and hash in NSDate
Date: Fri, 22 Jul 2005 07:40:26 -0500

----- Original Message ----- From: "Markus Hitter" <address@hidden>
To: "Jeremy Bettis" <address@hidden>
Cc: <address@hidden>
Sent: Thursday, July 21, 2005 7:22 PM
Subject: Re: isEqual: and hash in NSDate

- (BOOL) isEqual: (id)other
{
[...]
  if ([other isKindOfClass: abstractClass]
    && (int)(otherTime(self)+0.5) == (int)(otherTime(other)+0.5) )

Any reason why you don't want to compare [self hash] to [other hash]?


otherTime() accesses the instance var directly when it can and looks as lightweight or lighter than calling -hash. Other than that, no reason.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]