Skip to content

Commit

Permalink
Remove extraneous map toPersistValue call. (#1468)
Browse files Browse the repository at this point in the history
The list produced by `toPersistFields entity` is already of type `[PersistValue]`.
  • Loading branch information
arrowd committed Feb 1, 2023
1 parent 6fdbf84 commit 356a081
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions persistent/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog for persistent

## unreleased

* [#1460] https://github.com/yesodweb/persistent/pull/1468
* Remove extraneous `map toPersistValue` call in the `mkInsertValues`
function, as it evaluates to `id`.

## 2.14.4.4

* [#1460] https://github.com/yesodweb/persistent/pull/1460
Expand Down
1 change: 0 additions & 1 deletion persistent/Database/Persist/Sql/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ mkInsertValues
mkInsertValues entity =
Maybe.catMaybes
. zipWith redactGeneratedCol (getEntityFields . entityDef $ Just entity)
. map toPersistValue
$ toPersistFields entity
where
redactGeneratedCol fd pv = case fieldGenerated fd of
Expand Down

0 comments on commit 356a081

Please sign in to comment.