Skip to content

Commit

Permalink
schema: Avoid creating empty Expr slice if Constraint is set (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko authored Apr 5, 2023
1 parent 31f5cd3 commit fba9786
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion schema/attribute_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ func (as *AttributeSchema) Copy() *AttributeSchema {
IsSensitive: as.IsSensitive,
IsDepKey: as.IsDepKey,
Description: as.Description,
Expr: as.Expr.Copy(),
Address: as.Address.Copy(),
OriginForTarget: as.OriginForTarget.Copy(),
SemanticTokenModifiers: as.SemanticTokenModifiers.Copy(),
Expand All @@ -154,6 +153,8 @@ func (as *AttributeSchema) Copy() *AttributeSchema {

if as.Constraint != nil {
newAs.Constraint = as.Constraint.Copy()
} else {
newAs.Expr = as.Expr.Copy()
}

return newAs
Expand Down

0 comments on commit fba9786

Please sign in to comment.