guybedford opened issue #6740:
Feature
Change the adapter implementation to always ensure that
blocking_read
returning adone
value oftrue
will not callblocking_read
again requiring an unnecessary empty vec, as this function call is effectively redundant.Benefit
It removes redundancy in the read calls.
Implementation
Not sure, would be good to weigh up that it doesn't complicate the implementation.
Alternatives
It's fine to leave as-is for now, so this is certainly non-urgent, but it could also be nice to implement non-redundancy.
jameysharp commented on issue #6740:
This sounds like the kind of thing which either is surprisingly complicated or would be a nice candidate for the "good first issue" tag. I'd love it if somebody could take enough of a look to decide which of those it is, and if it's the latter, leave a few hints here in case somebody out there wants a project to work on.
sunfishcode commented on issue #6740:
I think the most straightforward way to do this would be to add a
at_end
flag to theStreams
struct, set it whenblocking_read
indicates the end is reached, and check it before callingblocking_read
. And clear it infd_seek
at the same time it doesstream.input.set(None)
.
Last updated: Dec 23 2024 at 12:05 UTC