Skip to content

Commit 3e5690e

Browse files
committed
trim!: Remove some allocations
1 parent b648f83 commit 3e5690e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/table/dtable.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,11 @@ Removes empty chunks from `d`.
235235
"""
236236
function trim!(d::DTable)
237237
check_result = [Dagger.@spawn isnonempty(c) for c in d.chunks]
238-
d.chunks = getindex.(filter(x -> fetch(check_result[x[1]]), collect(enumerate(d.chunks))), 2)
238+
for idx in length(d.chunks):-1:1
239+
if !fetch(check_result[idx])
240+
deleteat!(d.chunks, idx)
241+
end
242+
end
239243
return d
240244
end
241245

0 commit comments

Comments
 (0)