Dispatching on a variant

Jeremie Pelletier jeremiep at gmail.com
Sat Sep 26 21:20:44 PDT 2009


Jarrett Billingsley wrote:
> On Sat, Sep 26, 2009 at 11:16 PM, Jeremie Pelletier <jeremiep at gmail.com> wrote:
> 
>> string switch actually walks the case strings and compares with the source
>> string until it finds a match, a binary search is much faster if you don't
>> care about the order of the tests.
> 
> FWIW the runtime does perform a binary search of the strings in a
> switch. The compiler outputs the string table as a sorted list.

Oh, you're right! I just checked in druntime.



More information about the Digitalmars-d mailing list