nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
lib/map: document `Map.has_key` and implement it efficienlty
[nit.git]
/
lib
/
standard
/
collection
/
hash_collection.nit
diff --git
a/lib/standard/collection/hash_collection.nit
b/lib/standard/collection/hash_collection.nit
index
b62d876
..
cdc7906
100644
(file)
--- a/
lib/standard/collection/hash_collection.nit
+++ b/
lib/standard/collection/hash_collection.nit
@@
-274,6
+274,7
@@
class HashMap[K, V]
redef var keys: RemovableCollection[K] = new HashMapKeys[K, V](self)
redef var values: RemovableCollection[V] = new HashMapValues[K, V](self)
+ redef fun has_key(k) do return node_at(k) != null
end
# View of the keys of a HashMap