Closed lmiq closed 2 months ago
I have ran the OhMyThreads
tests with this, and everything is fine there.
@carstenbauer and/or @MasonProtter
Let me know if you see any issue with this PR, when possible. It is simple, the question is mostly about if you see any conceptual problem related to the change.
Currently, the
getchunk
function returnsnothing
if the iterator is empty:This can cause type-instabilities in situations where everything is in fact iterable. For example (now running with the development branch, with the https://github.com/JuliaFolds2/ChunkSplitters.jl/pull/37 PR merged already):
To solve this issue, we need to return, instead of
nothing
, an empty iterator. For:batch
, return0:-1
, for:scatter
, return0:1:-1
.With this PR, we get:
It is a bit less elegant to return an arbitrary empty iterator rather than nothing, but that does not seem to justify the possibility of propagating a type instability.