Skip to content

Commit b6bd5f5

Browse files
committed
EnumX --> Symbol is slow
1 parent 6fd247c commit b6bd5f5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/default.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ function defaultalg(A, b, assump::OperatorAssumptions{Bool})
218218
DefaultLinearSolver(alg)
219219
end
220220

221+
@inline algchoice_to_alg(::Val{alg}) where {alg} = algchoice_to_alg(alg)
221222
function algchoice_to_alg(alg::Symbol)
222223
if alg === :SVDFactorization
223224
SVDFactorization(false, LinearAlgebra.QRIteration())
@@ -345,11 +346,12 @@ end
345346
retcode = sol.retcode,
346347
iters = sol.iters, stats = sol.stats)
347348
end
349+
alg_enum = getproperty(LinearSolve.DefaultAlgorithmChoice, alg)
348350
ex = if ex == :()
349-
Expr(:elseif, :(Symbol(alg.alg) === $(Meta.quot(alg))), newex,
351+
Expr(:elseif, :(alg.alg == $(alg_enum)), newex,
350352
:(error("Algorithm Choice not Allowed")))
351353
else
352-
Expr(:elseif, :(Symbol(alg.alg) === $(Meta.quot(alg))), newex, ex)
354+
Expr(:elseif, :(alg.alg == $(alg_enum)), newex, ex)
353355
end
354356
end
355357
ex = Expr(:if, ex.args...)

0 commit comments

Comments
 (0)