[OT] The horizon of a stream

bearophile bearophileHUGS at lycos.com
Thu Oct 23 13:34:31 PDT 2008


bearophile:
> This versions compares hash values first, avoiding some slower
> string compares, because in D1 strings don't store their hash value:
>...
>         auto pos_ptr = record(hash_clean_line, clean_line) in seen;

Ignore this solution, it's not faster, because the whole string is hashed two times, etc. You have to use a String class like mine that lazily computes and stores the hash value too...

Bye,
bearophile



More information about the Digitalmars-d mailing list