diff options
author | Matthias Zenger <mzenger@gmail.com> | 2003-06-09 20:18:08 +0000 |
---|---|---|
committer | Matthias Zenger <mzenger@gmail.com> | 2003-06-09 20:18:08 +0000 |
commit | 528c521f9d4984cd61e0178b2e8c4f8768985e53 (patch) | |
tree | f1892058a920f81b8658ee80fbe276ad4e097738 /sources | |
parent | 469714eafebb0d7e8f58ef9d81a2db7866724b5a (diff) | |
download | scala-528c521f9d4984cd61e0178b2e8c4f8768985e53.tar.gz scala-528c521f9d4984cd61e0178b2e8c4f8768985e53.tar.bz2 scala-528c521f9d4984cd61e0178b2e8c4f8768985e53.zip |
Implemented support for hash tables that are no...
Implemented support for hash tables that are not supposed to be resized.
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scala/HashTable.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sources/scala/HashTable.scala b/sources/scala/HashTable.scala index e6cbdcf21c..8d551a1c52 100644 --- a/sources/scala/HashTable.scala +++ b/sources/scala/HashTable.scala @@ -21,6 +21,10 @@ abstract class HashTable[A] { */ protected val initialSize: Int = 16; + /** The initial threshold + */ + protected val initialThreshold: Int = ((initialSize as Float) * loadFactor) as Int; + /** The actual hash table. */ protected var table: Array[List[Entry]] = new Array(initialSize); @@ -32,7 +36,7 @@ abstract class HashTable[A] { /** The next size value at which to resize (capacity * load factor). */ - protected var threshold: Int = ((initialSize as Float) * loadFactor) as Int; + protected var threshold: Int = initialThreshold; /** Returns the size of this hash map. */ |