lib/map: document `Map.has_key` and implement it efficienlty
[nit.git] / lib / standard / collection / hash_collection.nit
index b62d876..cdc7906 100644 (file)
@@ -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