Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Assigned() vs. <> nil (https://www.delphipraxis.net/32104-assigned-vs-nil.html)

Pseudemys Nelsoni 18. Okt 2004 22:17


Assigned() vs. <> nil
 
moin,

welche derbeiden möglichkeiten ist schneller? und ist somit die andere nutzlos?

Dax 18. Okt 2004 22:19

Re: Assigned() vs. <> nil
 
Ich hab's grade durchgespielt: Die sind identisch.

Luckie 18. Okt 2004 22:26

Re: Assigned() vs. <> nil
 
Zitat:

Zitat von Delphi in a Nutshell
If the pointer is a function pointer, using Assigned makes it clear that you do not intendto call the function and compare its result to nil. Thus, Assigned is often used to test. function and method pointers.


Pseudemys Nelsoni 18. Okt 2004 22:26

Re: Assigned() vs. <> nil
 
moin dax,

jo, das sie das gleiche tun weiss ich, ich frage mich nur was schneller ist. die funktion dürfte langsamer sein oder?

Dax 18. Okt 2004 22:29

Re: Assigned() vs. <> nil
 
Nein, Assigned(Pointer) produziert genau den selben Code wie Pointer <> nil, hab' den Disassembler benutzt. :P

Luckie 18. Okt 2004 22:31

Re: Assigned() vs. <> nil
 
Assigned ist keine wirkliche Funktion.

Dax 18. Okt 2004 22:33

Re: Assigned() vs. <> nil
 
Sondern, wie gesagt, Compiler-Magic. ;)

Pseudemys Nelsoni 18. Okt 2004 23:02

Re: Assigned() vs. <> nil
 
ah danke euch zwei ;)


Alle Zeitangaben in WEZ +1. Es ist jetzt 03:58 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz