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

Reply via email to