[DUG] Object is Object vs Object.Classname = 'Object'
David Moorhouse (DUG)
delphi at moorhouse.net.nz
Tue Jan 25 17:54:49 NZDT 2011
Have you timed it ?
My gut feeling is the first form is a pointer comparison, so would be
very quick, whereas the second form is a string comparison so not as quick.
Also the first has the advantage of compile time checking.
0.02c
D
On 25/01/11 17:46, Ross Levis wrote:
>
> Just as a matter of curiosity really, anyone know if there is any
> difference in speed for these 2 operations.
>
> if abc is TMyObject then
>
> and
>
> if abc.Classname = 'TMyObject' then
>
> ?
>
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject: unsubscribe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20110125/811db7b2/attachment.html
More information about the Delphi
mailing list