Page 1 of 2

A Question of Speed :)

PostPosted: Apr 17, 2002 @ 12:55am
by brendan

OR

PostPosted: Apr 17, 2002 @ 1:06am
by brendan

PostPosted: Apr 17, 2002 @ 2:47am
by Dan East

PostPosted: Apr 17, 2002 @ 3:46am
by Digby

PostPosted: Apr 17, 2002 @ 4:36am
by brendan

PostPosted: Apr 17, 2002 @ 6:01am
by Dan East
Right, you are better off storing it in a temporary variable if you're going to use a return value more than a couple times.

To expand on what Digby said, it simply makes sense to determine what conditions are most likely to cause the whole expression to fail. If you want to get very nit-picky, note that you check X first to make sure it is in range. Well, on a Pocket PC there are 33% "more" Y values than X. So assuming we're talking about square regions (on average), you should check Y first, as it has a higher probability of falling outside the range. :)

Dan East

OK....ish

PostPosted: Apr 17, 2002 @ 7:00am
by brendan

PostPosted: Apr 17, 2002 @ 8:57am
by refractor

PostPosted: Apr 17, 2002 @ 6:08pm
by Dan East

PostPosted: Apr 17, 2002 @ 6:16pm
by Dan East

PostPosted: Apr 17, 2002 @ 6:42pm
by Alfonso

PostPosted: Apr 17, 2002 @ 8:37pm
by Digby

PostPosted: Apr 17, 2002 @ 9:35pm
by Kzinti

PostPosted: Apr 18, 2002 @ 12:19am
by brendan

PostPosted: Apr 18, 2002 @ 10:52am
by Guest