tag:blogger.com,1999:blog-563071785757928434.post3586590286531994287..comments2024-02-21T08:31:04.853+01:00Comments on Kodierer [Coder]: Rect and Point Extension MethodsRene Schultehttp://www.blogger.com/profile/12777157871967896549noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-563071785757928434.post-73070485841880933302010-09-05T03:45:17.378+02:002010-09-05T03:45:17.378+02:00kranke scheißekranke scheißeAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-563071785757928434.post-39755897870152039292010-09-03T11:32:36.694+02:002010-09-03T11:32:36.694+02:00Rene, Morton,
You are both right.
The && ...Rene, Morton,<br />You are both right.<br /><br />The && (ANDALSO in VB.Net) and || (ORELSE in VB.Net) stop evaluating on the first conclusive result. <br />That is || stops on the first true expression, && stops on the first false expression.Jelle Hissinkhttp://www.codewise.nlnoreply@blogger.comtag:blogger.com,1999:blog-563071785757928434.post-40854116491626037072010-08-31T21:38:04.656+02:002010-08-31T21:38:04.656+02:00Hi Morten,
What you describe in the last sentenc...Hi Morten, <br /><br />What you describe in the last sentence is what the above code does.<br /><br />In the worst case my code tests 4 conditions, but it's mostly less for my scenarios. If the first condition in the OR is true, the method returns. AND on the other hand would be slower most of the times, since all AND conditions have to be tested.Rene Schultehttps://www.blogger.com/profile/12777157871967896549noreply@blogger.comtag:blogger.com,1999:blog-563071785757928434.post-88063749182194451992010-08-31T21:17:42.803+02:002010-08-31T21:17:42.803+02:00You can optimize that Intersect method a lot by in...You can optimize that Intersect method a lot by inverting it to use && instead. That way you don't have to check all the cases. As soon as you know that the box is to the right of the other, you don't really care if it's above or below it, and so on.Mortenhttp://www.sharpgis.netnoreply@blogger.com