Skip to content

Commit

Permalink
Don't keep files open in cholmod
Browse files Browse the repository at this point in the history
the non-do-block form of open should really be avoided
  • Loading branch information
tkelman committed Feb 26, 2015
1 parent bef6bf3 commit 93af265
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions base/sparse/cholmod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -726,10 +726,9 @@ end
Sparse(A::Dense) = dense_to_sparse(A, Cint)
Sparse(L::Factor) = factor_to_sparse!(copy(L))
function Sparse(filename::ByteString)
f = open(filename)
A = read_sparse(CFILE(f), SuiteSparse_long)
close(f)
A
open(filename) do f
return read_sparse(CFILE(f), SuiteSparse_long)
end
end

## convertion back to base Julia types
Expand Down

0 comments on commit 93af265

Please sign in to comment.