Check or direct function executing?
#4

Well obviously the second one is faster in general, because the worst case scenario in the first example is that you're calling 2 functions, the second example will always result in one function being called.

However! There is another factor, what if the checking function executes faster than the setting function? Then in some cases it may be better to do the check, but generally in most cases, it is not. At least not for a single function.
Reply


Messages In This Thread
Check or direct function executing? - by OldDirtyBastard - 01.03.2011, 19:43
AW: Check or direct function executing? - by Nero_3D - 01.03.2011, 19:48
Re: Check or direct function executing? - by OldDirtyBastard - 01.03.2011, 19:52
Re: Check or direct function executing? - by JaTochNietDan - 01.03.2011, 20:05

Forum Jump:


Users browsing this thread: 1 Guest(s)