About built-in AAs

Walter Bright newshound2 at digitalmars.com
Tue Aug 16 17:00:26 PDT 2011


On 8/16/2011 3:09 PM, bearophile wrote:
> 2) Originally built-in AAs used a search tree to resolve collisions, but I
> think since some time they use a simple linked list (this has the advantage
> of simplifying the code, but it has the disadvantage that now hashing is able
> to become O(n^2), allowing certain attacks to D code that where impossible
> before).

It wasn't changed to simplify code, it was changed because it was faster.

As for "attacks", if your code is subject to people sending it specially crafted 
input in the hopes of making it run slowly, you can make specially crafted input 
to make trees run slowly, too.


More information about the Digitalmars-d mailing list