between and among: worth Phobosization?

Walter Bright newshound2 at digitalmars.com
Mon Dec 16 16:53:05 PST 2013


On 12/16/2013 4:01 PM, "Ola Fosheim Grøstad" 
<ola.fosheim.grostad+dlang at gmail.com>" wrote:
> When I think of it, it might be better to let the compiler detect it and do this
> as a general optimization. Because you might be able to collapse two consecutive
> among() into a single lookup if the code-structure allows for it. So an early
> library optimization could reduce the ability to optimize at a later stage… *shrug*

It definitely is a good idea for the compiler to recognize:

    if (s == "foo" || s == "bar" || s == "baz")

and generate special code for it.



More information about the Digitalmars-d mailing list