From 4336ab00e470e88c89cedae258d0f4d3f14b40b0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Sun, 20 Dec 2015 09:21:58 -0500 Subject: [PATCH] lib/core: add a factory to `Set` to instantiate a `HashSet` by default MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/core/collection/hash_collection.nit | 5 +++++ 1 file changed, 5 insertions(+) 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] -- 1.7.9.5