diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2014-11-11 08:53:00 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2014-11-11 08:56:24 +0100 |
commit | 015bbc1c941912ffc43451304c50b6193cb2f4b2 (patch) | |
tree | f95fda282d574c0d9a59f1eb590b776b99711282 /src/dotty | |
parent | 892f7bdb4c35f701f7d925404ac55ebaa5566ae0 (diff) | |
download | dotty-015bbc1c941912ffc43451304c50b6193cb2f4b2.tar.gz dotty-015bbc1c941912ffc43451304c50b6193cb2f4b2.tar.bz2 dotty-015bbc1c941912ffc43451304c50b6193cb2f4b2.zip |
Scopes: make sure every bucket of the hash table is used
Previously, one bucket was never used because in binary,
12*2^n - 1 = 101111...
Diffstat (limited to 'src/dotty')
-rw-r--r-- | src/dotty/tools/dotc/core/Scopes.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/Scopes.scala b/src/dotty/tools/dotc/core/Scopes.scala index 09bdca196..cd1eacc91 100644 --- a/src/dotty/tools/dotc/core/Scopes.scala +++ b/src/dotty/tools/dotc/core/Scopes.scala @@ -28,9 +28,11 @@ object Scopes { private final val FillFactor = 2.0/3.0 /** A hashtable is created once current size exceeds MinHash * FillFactor - * The initial hash table has twice that size (i.e 24). + * The initial hash table has twice that size (i.e 16). + * This value must be a power of two, so that the index of an element can + * be computed as element.hashCode & (hashTable.length - 1) */ - private final val MinHash = 12 + private final val MinHash = 8 /** The maximal permissible number of recursions when creating * a hashtable |