Skip to content

Commit

Permalink
Use and instead of if nil as suggested in PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
tarun-nil committed Jan 14, 2024
1 parent 0789ac1 commit c75cd91
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions swift-ticketing/src/swift_ticketing/db/ticket.clj
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,8 @@
([db-spec ticket-ids status]
(reset-ticket-status db-spec ticket-ids status nil))
([db-spec ticket-ids status reservation-expiration-time]
(let [expiration-time (if (nil? reservation-expiration-time)
nil
[:cast (.toString reservation-expiration-time) :timestamptz])]
(let [expiration-time (and reservation-expiration-time
[:cast (.toString reservation-expiration-time) :timestamptz])]
(run-query!
db-spec
(sql/format {:update :ticket
Expand Down

0 comments on commit c75cd91

Please sign in to comment.