Dispatching on a variant

Jarrett Billingsley jarrett.billingsley at gmail.com
Sat Sep 26 20:23:52 PDT 2009


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.



More information about the Digitalmars-d mailing list