mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 10:31:02 +02:00
Can't reduce an empty list with the max function.
The max function requires at least 1 argument to be given, and in the
case where we have no table to load it then fails badly, as show here:
CL-USER> (handler-case
(reduce #'max nil)
(condition (c)
(format nil "~a" c)))
"invalid number of arguments: 0"
Of course Common Lisp comes with a very easy way around that problem:
CL-USER> (reduce #'max nil :initial-value 0)
0
Fix #381.
This commit is contained in:
parent
dcc926e90c
commit
7fc0812f79
@ -322,7 +322,8 @@
|
||||
"Count how many indexes maximum per table are listed in SCHEMA."
|
||||
(reduce #'max (mapcar #'length
|
||||
(mapcar #'table-index-list
|
||||
(schema-table-list schema)))))
|
||||
(schema-table-list schema)))
|
||||
:initial-value 0))
|
||||
"Count how many indexes maximum per table are listed in SCHEMA."
|
||||
|
||||
(defmethod max-indexes-per-table ((catalog catalog) &key)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user