lib/array: fix AbstractArray::unshift
authorJean Privat <jean@pryen.org>
Thu, 20 Mar 2014 01:40:00 +0000 (21:40 -0400)
committerJean Privat <jean@pryen.org>
Thu, 20 Mar 2014 09:21:30 +0000 (05:21 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

lib/standard/collection/array.nit

index 988ddbf..558f7c1 100644 (file)
@@ -176,7 +176,7 @@ abstract class AbstractArray[E]
        redef fun unshift(item)
        do
                var i = length - 1
-               while i > 0 do
+               while i >= 0 do
                        self[i+1] = self[i]
                        i -= 1
                end