Skip to content

Commit 7bcb471

Browse files
committed
Remove i var and replace splatting with explicit indexing
1 parent 44cc4cb commit 7bcb471

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Bridges/lazybridgeoptimizer.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,11 @@ function addbridge!(b::LazyBridgeOptimizer, BT::Type{<:AbstractBridge})
4646
changed = true # Has b.dist changed in the last iteration ?
4747
while changed
4848
changed = false
49-
i = 0
5049
for BT in b.bridgetypes
51-
i += 1
5250
for (F, S) in supportedconstrainttypes(BT)
53-
if all(C -> MOI.supportsconstraint(b, C...), addedconstrainttypes(BT, F, S))
51+
if all(C -> MOI.supportsconstraint(b, C[1], C[2]), addedconstrainttypes(BT, F, S))
5452
# Number of bridges needed using BT
55-
dist = sum(C -> _dist(b, C...), addedconstrainttypes(BT, F, S))
53+
dist = sum(C -> _dist(b, C[1], C[2]), addedconstrainttypes(BT, F, S))
5654
# Is it better that what can currently be done ?
5755
if dist < _dist(b, F, S)
5856
b.dist[(F, S)] = dist

0 commit comments

Comments
 (0)