aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorodersky <odersky@gmail.com>2014-11-11 12:23:36 +0100
committerodersky <odersky@gmail.com>2014-11-11 12:23:36 +0100
commitb164b6db3adca42e590099dcb1e12b14e218f367 (patch)
treef95fda282d574c0d9a59f1eb590b776b99711282
parent892f7bdb4c35f701f7d925404ac55ebaa5566ae0 (diff)
parent015bbc1c941912ffc43451304c50b6193cb2f4b2 (diff)
downloaddotty-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.scala6
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