Skip to content

Commit

Permalink
[parser] refactor the PR #8619 by introducing the FieldType.Clone() m…
Browse files Browse the repository at this point in the history
…ember function (#77)
  • Loading branch information
dbjoa authored and ti-chi-bot committed Oct 9, 2021
1 parent 03f56ba commit 3fb7739
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions parser/types/field_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ func NewFieldType(tp byte) *FieldType {
}
}

// Clone returns a copy of itself.
func (ft *FieldType) Clone() *FieldType {
ret := *ft
return &ret
}

// Equal checks whether two FieldType objects are equal.
func (ft *FieldType) Equal(other *FieldType) bool {
// We do not need to compare whole `ft.Flag == other.Flag` when wrapping cast upon an Expression.
Expand Down

0 comments on commit 3fb7739

Please sign in to comment.