• 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: NSEvent isEqual
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >NSEvent isEqual (From: Ken Victor <email@hidden>)
 >Re: NSEvent isEqual (From: Ondra Cada <email@hidden>)
 >Re: NSEvent isEqual (From: Ken Victor <email@hidden>)

  • Prev by Date: Re: NSEvent isEqual
  • Next by Date: Re: NSEvent isEqual
  • Previous by thread: Re: NSEvent isEqual
  • Next by thread: Re: NSEvent isEqual
  • Index(es):
    • Date
    • Thread