Skip to content

Commit 6e7eb0a

Browse files
authored
fix: apply De Morgan to avoid negated conjunction in schema/relationship.go (staticcheck QF1001) (#7648)
1 parent 0011f39 commit 6e7eb0a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

schema/relationship.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,8 +669,9 @@ func (rel *Relationship) ParseConstraint() *Constraint {
669669
if r != rel && r.FieldSchema == rel.Schema && len(rel.References) == len(r.References) {
670670
matched := true
671671
for idx, ref := range r.References {
672-
if !(rel.References[idx].PrimaryKey == ref.PrimaryKey && rel.References[idx].ForeignKey == ref.ForeignKey &&
673-
rel.References[idx].PrimaryValue == ref.PrimaryValue) {
672+
if rel.References[idx].PrimaryKey != ref.PrimaryKey ||
673+
rel.References[idx].ForeignKey != ref.ForeignKey ||
674+
rel.References[idx].PrimaryValue != ref.PrimaryValue {
674675
matched = false
675676
break
676677
}

0 commit comments

Comments
 (0)