At 10:07 AM -0800 3/29/06, Steve Upton wrote:
> Dim item As FolderItem = TargetFolder.TrueItem(indexT)
TargetName = item.DisplayName
TargetPath = item.ShellPath
Hi Joe,
OK, I dig the clearer and easier to debug part but... faster?
Can you elaborate on that? I often avoid temp variables thinking
they will slow things down with the required allocation of memory
and other steps...
Oh no. When you make a function call, there is a temp variable
created to hold the result anyway. But in your original code, after
using this, you threw it away and called the function again on the
next line -- which creates a second temp variable, to hold the
(redundant) result of the second call.
But even if there weren't implicit temp variables involved, the point
would still hold, because invoking a function is way more expensive
than the steps involved in creating or releasing variables. So,
never call a function twice when calling it once will do, at least
when speed is your concern.
Best,
- Joe
--
Joseph J. Strout
[EMAIL PROTECTED]
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>