We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 720f685 commit c0cbfd1Copy full SHA for c0cbfd1
go/sql/types.go
@@ -246,16 +246,13 @@ func (this *ColumnList) IsSubsetOf(other *ColumnList) bool {
246
}
247
248
func (this *ColumnList) FilterBy(f func(Column) bool) *ColumnList {
249
- filteredList := &ColumnList{}
250
- filteredList.Ordinals = this.Ordinals
251
- filteredCols := []Column{}
+ filteredCols := make([]Column, 0, len(this.columns))
252
for _, column := range this.columns {
253
if f(column) {
254
filteredCols = append(filteredCols, column)
255
256
257
- filteredList.columns = filteredCols
258
- return filteredList
+ return &ColumnList{Ordinals: this.Ordinals, columns: filteredCols}
259
260
261
func (this *ColumnList) Len() int {
0 commit comments