Fix bug in constraint maker duplicating constraints

This commit is contained in:
Robert Payne 2016-12-26 01:00:44 +13:00
parent 3838029c66
commit 556536859e
1 changed files with 2 additions and 18 deletions

View File

@ -175,25 +175,9 @@ public class ConstraintMaker {
closure(maker) closure(maker)
var constraints: [Constraint] = [] var constraints: [Constraint] = []
for description in maker.descriptions { for description in maker.descriptions {
guard let constraint = description.constraint else {
guard let relation = description.relation, continue
let related = description.related,
let sourceLocation = description.sourceLocation else {
continue
} }
let from = ConstraintItem(target: description.item, attributes: description.attributes)
let constraint = Constraint(
from: from,
to: related,
relation: relation,
sourceLocation: sourceLocation,
label: description.label,
multiplier: description.multiplier,
constant: description.constant,
priority: description.priority
)
constraints.append(constraint) constraints.append(constraint)
} }
for constraint in constraints { for constraint in constraints {