Skip to content

Commit

Permalink
modify ColumnList creation
Browse files Browse the repository at this point in the history
  • Loading branch information
meiji163 committed Dec 18, 2024
1 parent 720f685 commit c0cbfd1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions go/sql/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,13 @@ func (this *ColumnList) IsSubsetOf(other *ColumnList) bool {
}

func (this *ColumnList) FilterBy(f func(Column) bool) *ColumnList {
filteredList := &ColumnList{}
filteredList.Ordinals = this.Ordinals
filteredCols := []Column{}
filteredCols := make([]Column, 0, len(this.columns))
for _, column := range this.columns {
if f(column) {
filteredCols = append(filteredCols, column)
}
}
filteredList.columns = filteredCols
return filteredList
return &ColumnList{Ordinals: this.Ordinals, columns: filteredCols}
}

func (this *ColumnList) Len() int {
Expand Down

0 comments on commit c0cbfd1

Please sign in to comment.