From: Alexis Laferrière Date: Sun, 20 Dec 2015 14:21:58 +0000 (-0500) Subject: lib/core: add a factory to `Set` to instantiate a `HashSet` by default X-Git-Tag: v0.8~15^2~8 X-Git-Url: http://nitlanguage.org lib/core: add a factory to `Set` to instantiate a `HashSet` by default Signed-off-by: Alexis Laferrière --- diff --git a/lib/core/collection/hash_collection.nit b/lib/core/collection/hash_collection.nit index 926a1d9..c049332 100644 --- a/lib/core/collection/hash_collection.nit +++ b/lib/core/collection/hash_collection.nit @@ -20,6 +20,11 @@ redef class Map[K, V] new do return new HashMap[K, V] end +redef class Set[E] + # Get an instance of `HashMap[K, V]`, the default implementation + new do return new HashSet[E] +end + # A HashCollection is an array of HashNode[K] indexed by the K hash value private abstract class HashCollection[K] type N: HashNode[K]