Port a benchmark to D?

bearophile bearophileHUGS at lycos.com
Sat Jun 4 15:20:35 PDT 2011


>     void add(T x) {
>         /*static*/ foreach (i; Range!maxLength)
>             if (x == data[i])
>                 return;

Sorry, this code is wrong, it has to iterate from 0 to length.

If some code doesn't have unittests then it's broken.

Bye,
bearophile


More information about the Digitalmars-d mailing list