Skip to content

Commit 36e9066

Browse files
committed
Fix _VarArray size initialization logic
1 parent c681f94 commit 36e9066

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pyscipopt/scip.pxi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,8 +2509,8 @@ cdef class _VarArray:
25092509
else:
25102510
raise TypeError(f"Expected Variable or list of Variable, got {type(vars)}.")
25112511

2512-
if vars:
2513-
self.size = len(vars)
2512+
self.size = len(vars)
2513+
if self.size:
25142514
self.ptr = <SCIP_VAR**> malloc(self.size * sizeof(SCIP_VAR*))
25152515
for i, var in enumerate(vars):
25162516
if not isinstance(var, Variable):

0 commit comments

Comments
 (0)