File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -250,10 +250,7 @@ function _try_scalar_affine_function(expr::Expr)
250
250
if expr. args[1 ] == :+
251
251
args = _try_scalar_affine_function .(expr. args[2 : end ])
252
252
if ! any (isnothing, args)
253
- if length (args) == 1
254
- return only (args)
255
- end
256
- return + (0.0 , args... )
253
+ return MOI. Utilities. operate (+ , Float64, args... )
257
254
end
258
255
elseif expr. args[1 ] == :*
259
256
args = _try_scalar_affine_function .(expr. args[2 : end ])
@@ -263,10 +260,7 @@ function _try_scalar_affine_function(expr::Expr)
263
260
n_affine_terms += arg isa MOI. ScalarAffineFunction{Float64}
264
261
end
265
262
if n_affine_terms <= 1
266
- if length (args) == 1
267
- return only (args)
268
- end
269
- return * (args... )
263
+ return MOI. Utilities. operate (* , Float64, args... )
270
264
end
271
265
end
272
266
return nothing
You can’t perform that action at this time.
0 commit comments