Skip to content

Commit 4d84056

Browse files
committed
Return computed res when creating Expr
Fix a bug where the method returned the original 'terms' variable instead of the newly built 'res' dictionary. The change ensures Expr is constructed from the computed aggregation (res), preventing stale/incorrect expression data after the operation.
1 parent 0dca5c2 commit 4d84056

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/pyscipopt/expr.pxi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ cdef class Expr:
270270
res[child] = <double>(<object>old_v_ptr) + prod_v
271271
else:
272272
res[child] = prod_v
273-
return Expr(terms)
273+
return Expr(res)
274274

275275
def __truediv__(self, other):
276276
if not isinstance(other, EXPR_OP_TYPES):

0 commit comments

Comments
 (0)