Skip to content

Commit b168b28

Browse files
authored
Merge pull request #111 from klocs/throw_away_cleanup
clean up code in _throw_away()
2 parents 136f130 + e0721d3 commit b168b28

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

adafruit_requests.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,9 @@ def _throw_away(self, nbytes: int) -> None:
322322
to_read = len_buf
323323
while to_read > 0:
324324
to_read -= self._recv_into(buf, to_read)
325-
remaining = nbytes % len_buf
326-
if remaining:
327-
while remaining > 0:
328-
remaining -= self._recv_into(buf, remaining)
325+
to_read = nbytes % len_buf
326+
while to_read > 0:
327+
to_read -= self._recv_into(buf, to_read)
329328

330329
def close(self) -> None:
331330
"""Drain the remaining ESP socket buffers. We assume we already got what we wanted."""

0 commit comments

Comments
 (0)