diff options
author | odersky <odersky@gmail.com> | 2014-11-11 12:23:36 +0100 |
---|---|---|
committer | odersky <odersky@gmail.com> | 2014-11-11 12:23:36 +0100 |
commit | b164b6db3adca42e590099dcb1e12b14e218f367 (patch) | |
tree | f95fda282d574c0d9a59f1eb590b776b99711282 | |
parent | 892f7bdb4c35f701f7d925404ac55ebaa5566ae0 (diff) | |
parent | 015bbc1c941912ffc43451304c50b6193cb2f4b2 (diff) | |
download | dotty-b164b6db3adca42e590099dcb1e12b14e218f367.tar.gz dotty-b164b6db3adca42e590099dcb1e12b14e218f367.tar.bz2 dotty-b164b6db3adca42e590099dcb1e12b14e218f367.zip |
Merge pull request #221 from smarter/fix/Scopes-indexing
Scopes: make sure every bucket of the hash table is used
-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 |