unique_count empty string bug fix

This commit is contained in:
Adrian Mariano 2020-03-18 21:31:22 -04:00
parent 02ab8ea1d8
commit 6fa46ecb7c

View file

@ -798,6 +798,7 @@ function unique(arr) =
// arr = The list to analyze.
function unique_count(arr) =
assert(is_list(arr) || is_string(arr))
arr == [] ? [[],[]] :
let( arr=sort(arr) )
let(ind = [0,for(i=[1:1:len(arr)-1]) if (arr[i]!=arr[i-1]) i])
[select(arr,ind),