Skip to content

Commit 866d810

Browse files
committed
automatic promotion using collect in extrema_from_split_array
1 parent fa8ed14 commit 866d810

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/ParallelUtilities.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,8 @@ nworkers_active(args...) = length(workers_active(args...))
174174

175175
function extrema_from_split_array(iterable)
176176
val_first = first(iterable)
177-
N = length(val_first)
178-
T = reduce(promote_type,typeof.(val_first))
179-
min_vals = Vector{T}(undef,N)
180-
min_vals .= val_first
181-
max_vals = Vector{T}(undef,N)
182-
max_vals .= val_first
177+
min_vals = collect(val_first)
178+
max_vals = copy(min_vals)
183179

184180
for val in iterable
185181
for (ind,vi) in enumerate(val)

0 commit comments

Comments
 (0)