From 264f39fbec11a63019b46bafe985e2ad42dd0f66 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Tue, 26 Nov 2024 10:53:08 +1300 Subject: [PATCH] Remove unreachable code branch (#300) We build OptimizerCache{T} in MOI.optimize!, so we cannot have a different T here. --- src/MOI_wrapper/MOI_wrapper.jl | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/MOI_wrapper/MOI_wrapper.jl b/src/MOI_wrapper/MOI_wrapper.jl index cad6c80..c92ec19 100644 --- a/src/MOI_wrapper/MOI_wrapper.jl +++ b/src/MOI_wrapper/MOI_wrapper.jl @@ -260,13 +260,7 @@ function MOI.optimize!( src::MOI.Utilities.UniversalFallback{OptimizerCache{T}}, ) where {T} linear_solver = get(dest.options, :linear_solver, DirectSolver) - if T != scsint_t(linear_solver) - cache = MOI.Utilities.UniversalFallback( - OptimizerCache{scsint_t(linear_solver)}(), - ) - MOI.copy_to(cache, src) - return MOI.optimize!(dest, cache) - end + @assert T == scsint_t(linear_solver) # The real stuff starts here. MOI.empty!(dest) index_map = MOI.Utilities.identity_index_map(src)