From 9db7661efba5ea601c27126d26d9261c1a12884d Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Tue, 8 Sep 2026 15:12:02 +1200 Subject: [PATCH] Change an instance of _data to _maybe_data --- src/MathOptLazy.jl | 2 +- test/runtests.jl | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/MathOptLazy.jl b/src/MathOptLazy.jl index f9020af..4ad5156 100644 --- a/src/MathOptLazy.jl +++ b/src/MathOptLazy.jl @@ -440,7 +440,7 @@ function MOI.get( attr::MOI.ListOfConstraintIndices{F,S}, ) where {F<:MOI.AbstractScalarFunction,S<:MOI.AbstractScalarSet} ret = MOI.get(model.inner, attr) - if (data = _data(model, F, S)) !== nothing + if (data = _maybe_data(model, F, S)) !== nothing in_model = Set(ci for (ci, z) in zip(data.index, data.active) if z) ret = filter!(ci -> !(ci in in_model), ret) end diff --git a/test/runtests.jl b/test/runtests.jl index 153592b..2afa1bd 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -101,6 +101,9 @@ function _basic_constraint_test_helper( F, S, IS = typeof(constraint_function), typeof(set), typeof(inner_set) @test MOI.supports_constraint(model, F, S) @test MOI.get(model, MOI.NumberOfConstraints{F,S}()) == 0 + @test isempty(MOI.get(model, MOI.ListOfConstraintIndices{F,S}())) + @test MOI.get(model, MOI.NumberOfConstraints{F,IS}()) == 0 + @test isempty(MOI.get(model, MOI.ListOfConstraintIndices{F,IS}())) c = MOI.add_constraint(model, constraint_function, set) if activate data = MathOptLazy._data(model, F, IS)