[DUG] In [set] efficiency
Rohit Gupta
rohit at cfl.co.nz
Thu Jul 28 14:52:28 NZST 2016
Steve,
I am pretty sure you are correct. This happened when they scrapped the
pascal compiler and changed the c compiler to do pascal. One of the
changes then was that you could not use the same selector value twice in
the case statement. Before that time, you could.
Rohit
On 8/06/2016 17:27, Steve Peacocke wrote:
> 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
> <mailto: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 <mailto: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
>> <mailto:delphi-request at listserver.123.net.nz> with Subject: unsubscribe
>
>
> _______________________________________________
> 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
--
Regards
*Rohit Gupta*
B.E. Elec., M.E., Mem IEEE, Mem IET
Technical Director
Computer Fanatics Ltd
*Tel *4892280
*Fax *4892290
*Web *www.cfl.co.nz
------------------------------------------------------------------------
This email and any attachments contain information, which is
confidential and may be subject to legal privilege and copyright. If you
are not the intended recipient, you must not use, distribute or copy
this email or attachments. If you have received this in error, please
notify us immediately by return email and then delete this email and any
attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20160728/56e6dcb9/attachment.html
More information about the Delphi
mailing list