Skip to content

Commit

Permalink
Put back
Browse files Browse the repository at this point in the history
  • Loading branch information
danafallon committed Jul 16, 2024
1 parent 6831601 commit 59b91f2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/typing/columns/columns.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,9 @@ func (c *Columns) DeleteColumn(name string) {
func RemoveDeleteColumnMarker(cols []Column) ([]Column, bool) {
origLength := len(cols)
// Use [slices.Clone] because [slices.DeleteFunc] mutates its inputs.
cols = slices.DeleteFunc(slices.Clone(cols), func(col Column) bool {
return col.Name() == constants.DeleteColumnMarker
})
cols = slices.DeleteFunc(slices.Clone(cols), func(col Column) bool { return col.Name() == constants.DeleteColumnMarker })
// TODO return an error if the lengths aren't different, instead of a boolean
return cols, origLength != len(cols)
return cols, len(cols) != origLength
}

func RemoveOnlySetDeletedColumnMarker(cols []Column) ([]Column, bool) {
Expand All @@ -254,7 +252,7 @@ func RemoveOnlySetDeletedColumnMarker(cols []Column) ([]Column, bool) {
return col.Name() == constants.OnlySetDeletedColumnMarker
})
// TODO return an error if the lengths aren't different, instead of a boolean
return cols, origLength != len(cols)
return cols, len(cols) != origLength
}

// ColumnNames takes a slice of [Column] and returns the names as a slice of strings.
Expand Down

0 comments on commit 59b91f2

Please sign in to comment.