Skip to content

Commit 4c06582

Browse files
Alexey Stukalovalyst
authored andcommitted
ParTable: better params unique check
1 parent 63fc6e8 commit 4c06582

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/frontend/specification/ParameterTable.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,10 @@ function update_partable!(
305305
"The length of `params` ($(length(params))) and their `values` ($(length(values))) must be the same",
306306
),
307307
)
308+
dup_params = nonunique(params)
309+
isempty(dup_params) ||
310+
throw(ArgumentError("Duplicate parameters detected: $(join(dup_params, ", "))"))
308311
params_dict = Dict(zip(params, values))
309-
if length(params_dict) != length(params)
310-
throw(ArgumentError("Duplicate parameter names in `params`"))
311-
end
312312
update_partable!(partable, column, params_dict, default)
313313
end
314314

0 commit comments

Comments
 (0)