From e3037e4ef0394faf118cf926fd03283995d6da1f Mon Sep 17 00:00:00 2001 From: Name <1911860538@qq.com> Date: Thu, 22 May 2025 10:49:19 +0800 Subject: [PATCH] perf: break early on match failure in ParseConstraint (#7402) Co-authored-by: 1911860538 --- schema/relationship.go | 1 + 1 file changed, 1 insertion(+) diff --git a/schema/relationship.go b/schema/relationship.go index ea2eed62..c60ff6d9 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 } }