Skip to content

Commit 0aaab9d

Browse files
Merge pull request #1563 from ecordell/weights
feat(resolver): don't build new clauses for weights
2 parents 54dd65a + 0f6f57f commit 0aaab9d

File tree

1 file changed

+1
-4
lines changed
  • pkg/controller/registry/resolver/sat

1 file changed

+1
-4
lines changed

pkg/controller/registry/resolver/sat/dict.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ func compileDict(installables []Installable) *dict {
159159
im := d.c.Lit()
160160
d.installables[im] = installable
161161
d.lits[installable.Identifier()] = im
162-
weights = append(weights, im)
163162
}
164163

165164
// Then build the constraints:
@@ -170,9 +169,7 @@ func compileDict(installables []Installable) *dict {
170169

171170
clauses := make([]z.Lit, 0, x.weight)
172171
for w := 0; w < x.weight; w++ {
173-
wm := d.c.Lit()
174-
weights = append(weights, wm)
175-
clauses = append(clauses, d.c.Implies(d.LitOf(installable.Identifier()), wm))
172+
weights = append(weights, d.lits[installable.Identifier()])
176173
}
177174

178175
if !x.Empty() {

0 commit comments

Comments
 (0)