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@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
unsubscribe
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
unsubscribe