The PR https://github.com/D-Programming-Language/druntime/pull/979 causes the benchmark druntime/benchmark/aabench/string.d to fail:
- aa.length is one larger than expected
- the word "vita" is counted one less than before
- when iterating over aa, one entry less than aa.length is traversed
Comment #1 by schveiguy — 2014-11-19T01:14:46Z
Found the issue.
The following code tests the problem (adding as a unit test), but is highly dependent on the AA implementation:
void main()
{
int[int] aa;
// make all values go into the last bucket (int hash is simply the int)
foreach(i; 0..16)
{
aa[3 + i * 4] = 1;
assert(aa.keys.length == i+1);
}
// now force a rehash, but with a different hash value (lower than current
// first used bucket)
aa[0] = 1;
assert(aa.keys.length == 17);
}
PR: https://github.com/D-Programming-Language/druntime/pull/1025
Comment #2 by github-bugzilla — 2014-11-19T07:03:14Z