Re: NSEvent isEqual
Re: NSEvent isEqual
- Subject: Re: NSEvent isEqual
- From: Ondra Cada <email@hidden>
- Date: Thu, 4 May 2006 00:25:16 +0200
Ken,
On 4.5.2006, at 0:15, Ken Victor wrote:
just comparing pointers as you suggest below is probably
sufficient, but there is a possibility (albeit probably very small)
that if stack/heap is reused that a pointer compare would yield a
false positive. thus, to be truly safe (so i don't have to debug it
5 years from now :-) ), in my code i define "identity" as being the
same pointer AND isEqual being true. (suspenders and a belt!)
Aha. Well... if you wanna be *really* defensive, then still use the
identity (pointer compare), but *do* retain the oldEvent. That way
you can be absolutely (*) sure (with your suggestion there still is a
possibility the re-used address might contain an equal event). And
frankly, it would be somewhat cleaner intention-revealing-wise :)
(*) unless AppKit re-uses events, which possibility, I think, we may
boldly dare to dismiss :)
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden