Signed-off-by: Jean Privat <jean@pryen.org>
-redef class HashCollection[K,N]
+redef class HashCollection[K]
redef fun node_at_idx(i,k)
do
sys.gt_count += 1
redef fun node_at_idx(i,k)
do
sys.gt_count += 1
import array
# A HashCollection is an array of HashNode[K] indexed by the K hash value
import array
# A HashCollection is an array of HashNode[K] indexed by the K hash value
-private abstract class HashCollection[K: Object, N: HashNode[Object]]
+private abstract class HashCollection[K: Object]
+ type N: HashNode[K]
private var array: nullable NativeArray[nullable N] = null # Used to store items
private var capacity: Int = 0 # Size of _array
private var array: nullable NativeArray[nullable N] = null # Used to store items
private var capacity: Int = 0 # Size of _array
# Keys of such a map cannot be null and require a working `hash` method
class HashMap[K: Object, V]
super Map[K, V]
# Keys of such a map cannot be null and require a working `hash` method
class HashMap[K: Object, V]
super Map[K, V]
- super HashCollection[K, HashMapNode[K, V]]
+ super HashCollection[K]
+
+ redef type N: HashMapNode[K, V] is fixed
# Keys of such a map cannot be null and require a working `hash` method
class HashSet[E: Object]
super Set[E]
# Keys of such a map cannot be null and require a working `hash` method
class HashSet[E: Object]
super Set[E]
- super HashCollection[E, HashSetNode[E]]
+ super HashCollection[E]
+
+ redef type N: HashSetNode[E] is fixed
redef fun length do return _the_length
redef fun length do return _the_length