Skip to content

Commit b164b6d

Browse files
committed
Merge pull request #221 from smarter/fix/Scopes-indexing
Scopes: make sure every bucket of the hash table is used
2 parents 892f7bd + 015bbc1 commit b164b6d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/dotty/tools/dotc/core/Scopes.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ object Scopes {
2828
private final val FillFactor = 2.0/3.0
2929

3030
/** A hashtable is created once current size exceeds MinHash * FillFactor
31-
* The initial hash table has twice that size (i.e 24).
31+
* The initial hash table has twice that size (i.e 16).
32+
* This value must be a power of two, so that the index of an element can
33+
* be computed as element.hashCode & (hashTable.length - 1)
3234
*/
33-
private final val MinHash = 12
35+
private final val MinHash = 8
3436

3537
/** The maximal permissible number of recursions when creating
3638
* a hashtable

0 commit comments

Comments
 (0)