From b16d8e4283a450a6ed4b0400cfe6a27e0219feea Mon Sep 17 00:00:00 2001 From: Pascal Sommer Date: Sun, 1 Dec 2019 18:13:51 +0100 Subject: [PATCH] fix matrix.copy indices --- lua/matrix.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/matrix.lua b/lua/matrix.lua index 83f7d57..2eb1608 100644 --- a/lua/matrix.lua +++ b/lua/matrix.lua @@ -740,9 +740,9 @@ end function matrix.copy( m1 ) local docopy = matrix.type( m1 ) == "number" and num_copy or t_copy local mtx = {} - for i = 1,#m1[1] do + for i = 1,#m1 do mtx[i] = {} - for j = 1,#m1 do + for j = 1,#m1[1] do mtx[i][j] = docopy( m1[i][j] ) end end