Skip to content

Commit 1af9378

Browse files
authored
reduce allocation in Record array construction (#114)
1 parent 6ba1c4a commit 1af9378

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/all_implementations.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -1931,11 +1931,11 @@ RecordArray(
19311931
behavior::Symbol = :default,
19321932
) where {FIELDS,CONTENTS<:Base.Tuple{Vararg{Content}}} = RecordArray(
19331933
contents,
1934-
minimum(if length(contents) == 0
1934+
if isempty(contents)
19351935
0
19361936
else
1937-
[length(x) for x in contents]
1938-
end),
1937+
minimum(length, contents)
1938+
end,
19391939
parameters = parameters,
19401940
behavior = behavior,
19411941
)

0 commit comments

Comments
 (0)