Optimized transpose() slightly.

This commit is contained in:
Revar Desmera 2019-05-26 23:21:05 -07:00
parent 8f2b9c4ef1
commit 9a860c53ef

View file

@ -505,7 +505,6 @@ function array_dim(v, depth=undef) =
// Example:
// transpose([3,4,5]); // Returns: [3,4,5]
function transpose(arr) =
arr==[]? [] :
is_list(arr[0])? [for (i=[0:1:len(arr[0])-1]) [for (j=[0:1:len(arr)-1]) arr[j][i]]] : arr;