|
|
|
The standard way to test whether two object variables point to the same object is through the Is operator, as in: |
However, when both object are of the same type, or point to the same secondary interface, you can slightly optimize your code by testing whether the values returned by the ObjPtr() function match: |
This second line of code is about 40% faster than the Is operator. However, both statements are so efficient that you should perceive a difference only if the comparison is inside a time-critical loop that is executed some hundreds thousand times.
|
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|