Skip to content

Commit

Permalink
fix: fix getExcludedColumns slice allocation (#1788)
Browse files Browse the repository at this point in the history
`getExcludedColumns` allocates a slice of a particular length instead of
capacity, which does not achieve the intended effect -- memory
optimization.
  • Loading branch information
cuishuang authored Oct 10, 2024
1 parent aeb5d8f commit 7f006b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/storage/dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func getExcludedColumns(model interface{}, includeColumns ...string) ([]string,
cols.Remove(f)
}

xcols := make([]string, len(cols.Cols))
xcols := make([]string, 0, len(cols.Cols))
for n := range cols.Cols {
// gobuffalo updates the updated_at column automatically
if n == "updated_at" {
Expand Down

0 comments on commit 7f006b6

Please sign in to comment.