cc: [email protected]
Subject: Re: Re: [ast-developers] bool type not documented
--------

> What's the preferred form to use a bool for a plain *if* construct?
> bool conditional ... if $conditional ; then
> bool conditional ... if [[ $conditional == "true" ]] ; then
> bool conditional ... if ((conditional)) ; then
> 

I would use if ((conditional)) since it is fastest.

I ran a loop with 10,000 tests on each of the three.
        if $conditional took 16 seconds
        if [[ $conditional == "true" ]] took 10 seconds
        if ((conditional)) took 6 seconds

David Korn
[email protected]
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to