Skip to content

Commit 34b4ca1

Browse files
committed
Update transpose.jl
1 parent da5475e commit 34b4ca1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/dataset/transpose.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ function _fill_outputmat_withoutid(T, in_cols, ds, starts, perms, new_col_names,
411411
@assert _check_allocation_limit(nonmissingtype(T), row_names_length*_ngroups(ds), length(new_col_names)) < 1.0 "The output data frame is huge and there is not enough resource to allocate it."
412412
CT = promote_type(T, typeof(default_fill))
413413
# outputmat = [__fill!(_our_vect_alloc(CT, row_names_length*_ngroups(ds)), default_fill) for _ in 1:length(new_col_names)]
414-
outputmat = Vector{Vector{CT}}(undef, length(new_col_names))
414+
outputmat = Vector{typeof(_our_vect_alloc(CT, 0))}(undef, length(new_col_names))
415415
_preallocate_outputmat!(outputmat, row_names_length*_ngroups(ds), length(new_col_names), default_fill, threads, Val(CT) )
416416
update_outputmat!(outputmat, in_cols, starts, perms, row_names_length, threads)
417417

@@ -423,7 +423,7 @@ function _fill_outputmat_withid(T, in_cols, ds, starts, perms, ids, new_col_name
423423
@assert _check_allocation_limit(nonmissingtype(T), row_names_length*_ngroups(ds), length(new_col_names)) < 1.0 "The output data frame is huge and there is not enough resource to allocate it."
424424
CT = promote_type(T, typeof(default_fill))
425425
# outputmat = [fill!(_our_vect_alloc(CT, row_names_length*_ngroups(ds)), default_fill) for _ in 1:length(new_col_names)]
426-
outputmat = Vector{Vector{CT}}(undef, length(new_col_names))
426+
outputmat = Vector{typeof(_our_vect_alloc(CT, 0))}(undef, length(new_col_names))
427427
_preallocate_outputmat!(outputmat, row_names_length*_ngroups(ds), length(new_col_names), default_fill, threads, Val(CT) )
428428

429429
_is_cell_filled = zeros(Bool, row_names_length*_ngroups(ds), length(new_col_names))

0 commit comments

Comments
 (0)