From 61b5449a6233a5274d96b717834faa7ce47fbfa3 Mon Sep 17 00:00:00 2001 From: 1911860538 Date: Fri, 28 Mar 2025 21:23:09 +0800 Subject: [PATCH] perf: break early on match failure in ParseConstraint --- schema/relationship.go | 1 + 1 file changed, 1 insertion(+) diff --git a/schema/relationship.go b/schema/relationship.go index def4a595..c535cf07 100644 --- a/schema/relationship.go +++ b/schema/relationship.go @@ -663,6 +663,7 @@ func (rel *Relationship) ParseConstraint() *Constraint { if !(rel.References[idx].PrimaryKey == ref.PrimaryKey && rel.References[idx].ForeignKey == ref.ForeignKey && rel.References[idx].PrimaryValue == ref.PrimaryValue) { matched = false + break } }