lib: Map:[] aborts if key is not found
authorJean Privat <jean@pryen.org>
Thu, 11 Jun 2009 19:03:47 +0000 (15:03 -0400)
committerJean Privat <jean@pryen.org>
Wed, 24 Jun 2009 19:47:30 +0000 (15:47 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

lib/standard/abstract_collection.nit
lib/standard/array.nit

index cea7a6c..0f88388 100644 (file)
@@ -381,7 +381,7 @@ special Map[K, E]
        do
                var c = couple_at(key)
                if c == null then
-                       return null
+                       abort
                else
                        return c.second
                end
index 1f90388..d95911b 100644 (file)
@@ -411,7 +411,7 @@ special CoupleMap[K, E]
                if i >= 0 then
                        return _items[i].second
                else
-                       return null
+                       abort
                end
        end