nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
216bace
)
lib/more_collections: add `clean` to `HashMap[23]`
author
Alexis Laferrière
<alexis.laf@xymus.net>
Sat, 14 Feb 2015 19:29:02 +0000
(14:29 -0500)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Tue, 17 Feb 2015 21:14:14 +0000
(16:14 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/more_collections.nit
patch
|
blob
|
history
diff --git
a/lib/more_collections.nit
b/lib/more_collections.nit
index
004cc24
..
f9b55af
100644
(file)
--- 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.