niti: direclty use `Array::copy_to` to implements `NativeArray::copy_to`
authorJean Privat <jean@pryen.org>
Fri, 5 Dec 2014 01:53:41 +0000 (20:53 -0500)
committerJean Privat <jean@pryen.org>
Fri, 5 Dec 2014 01:53:41 +0000 (20:53 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

src/interpreter/naive_interpreter.nit

index 476608c..aecf720 100644 (file)
@@ -984,7 +984,7 @@ redef class AMethPropdef
                        else if pname == "length" then
                                return v.int_instance(recvval.length)
                        else if pname == "copy_to" then
-                               recvval.copy(0, args[2].to_i, args[1].val.as(Array[Instance]), 0)
+                               recvval.copy_to(0, args[2].to_i, args[1].val.as(Array[Instance]), 0)
                                return null
                        end
                else if cname == "NativeFile" then
@@ -1077,13 +1077,6 @@ redef class AMethPropdef
        end
 end
 
-redef class AbstractArray[E]
-       fun copy(start: Int, len: Int, dest: AbstractArray[E], new_start: Int)
-       do
-               self.copy_to(start, len, dest, new_start)
-       end
-end
-
 redef class AAttrPropdef
        redef fun call(v, mpropdef, args)
        do