[DUG] In [set] efficiency

Steve Peacocke steve at peacocke.net
Wed Jun 8 17:27:23 NZST 2016


If I remember correctly, the compiler changes both to array anyway so you come out with exactly the same compiled code. 

Perhaps someone can confirm this or tell me how wrong I am?

Steve Peacocke
+64 220 612-611


> On 8/06/2016, at 4:56 PM, Ross Levis <ross at stationplaylist.com> wrote:
> 
> I’m wondering which is more efficient to process...
>  
> if (a=1) or (a=2) then ...
>  
> or
>  
> if a in [1,2] then ...
>  
> If the answer is the first method, does it make a difference if more numbers are checked, eg. if a in [1..3,5] then
>  
> Cheers.
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at listserver.123.net.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at listserver.123.net.nz with Subject: unsubscribe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20160608/ba4563e5/attachment.html 


More information about the Delphi mailing list