From dc774e928f514935f399e21a4c7d0654134a5d85 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Sat, 14 Feb 2015 14:29:02 -0500 Subject: [PATCH] lib/more_collections: add `clean` to `HashMap[23]` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/more_collections.nit | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/more_collections.nit b/lib/more_collections.nit index 004cc24..f9b55af 100644 --- a/lib/more_collections.nit +++ b/lib/more_collections.nit @@ -93,6 +93,9 @@ class HashMap2[K1, K2, V] if level2 == null then return level2.keys.remove(k2) end + + # Remove all items + fun clear do level1.clear end # Simple way to store an `HashMap[K1, HashMap[K2, HashMap[K3, V]]]` @@ -137,6 +140,9 @@ class HashMap3[K1, K2, K3, V] if level2 == null then return level2.remove_at(k2, k3) end + + # Remove all items + fun clear do level1.clear end # A map with a default value. -- 1.7.9.5