From 504cefc23b8a9edec1931a29bb4f87a46b8c99c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Wed, 8 Apr 2026 14:58:18 +0200 Subject: [PATCH] Remove type piracy --- src/jump_moi_overloads.jl | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/jump_moi_overloads.jl b/src/jump_moi_overloads.jl index e3706796..6251215a 100644 --- a/src/jump_moi_overloads.jl +++ b/src/jump_moi_overloads.jl @@ -251,20 +251,6 @@ end MOI.constant(func::IndexMappedFunction) = MOI.constant(func.func) -# Support JuMP.coefficient on plain MOI functions returned by native solvers -function JuMP.coefficient( - func::MOI.ScalarAffineFunction{T}, - vi::MOI.VariableIndex, -) where {T} - coef = zero(T) - for term in func.terms - if term.variable == vi - coef += term.coefficient - end - end - return coef -end - function JuMP.coefficient(func::IndexMappedFunction, vi::MOI.VariableIndex) return JuMP.coefficient(func.func, func.index_map[vi]) end