From 0c617750a63436709816ee83a4028262755d43e0 Mon Sep 17 00:00:00 2001 From: John Lapeyre Date: Fri, 12 Dec 2014 18:50:07 +0100 Subject: [PATCH] fix empty list case --- src/PermPlain.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PermPlain.jl b/src/PermPlain.jl index 11e542f..4ce0205 100644 --- a/src/PermPlain.jl +++ b/src/PermPlain.jl @@ -517,6 +517,7 @@ end function listtosparse{T<:Real}(p::AbstractVector{T}) data = Dict{T,T}() maxk = zero(T) + length(p) == 0 && return (data,maxk) for i in p pv = p[i] if pv != i