Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use part when counting over chunk iterators #326

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/counting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
y
end

@inline function counter_1seq(tail::Function, body::Function, seq::SeqOrView)
(it, (chunk, rm)) = @inline iter_chunks(seq)
y = @inline tail(chunk, rm)
for i in it
y += @inline body(i)
@inline function counter_1seq(partial::Function, body::Function, seq::SeqOrView)
((head, head_bits), (chunk_start, chunk_end), (tail, tail_bits)) = parts(seq)
y = @inline partial(head, head_bits) + @inline partial(tail, tail_bits)
data = seq.data
@inbounds for i in chunk_start:chunk_end
y += @inline body(data[i])
end
y
y

Check warning on line 29 in src/counting.jl

View check run for this annotation

Codecov / codecov/patch

src/counting.jl#L29

Added line #L29 was not covered by tests
end

"""
Expand Down
Loading