Skip to content

Commit

Permalink
use list.clear()
Browse files Browse the repository at this point in the history
  • Loading branch information
kristjanvalur committed Oct 5, 2023
1 parent 55f43c9 commit 92d5067
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/resp.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def parse(self, buffer: bytes) -> Optional[Any]:
# create a new parser generator, initializing it with
# any unparsed data from previous calls
buffer = b"".join(self.consumed) + buffer
del self.consumed[:]
self.consumed.clear()
self.generator = self.parser.parse(buffer)
parsed = self.generator.send(None)
else:
Expand All @@ -386,7 +386,7 @@ def close(self) -> None:
if self.generator is not None:
self.generator.close()
self.generator = None
del self.consumed[:]
self.consumed.clear()


def parse_all(buffer: bytes) -> Tuple[List[Any], bytes]:
Expand Down

0 comments on commit 92d5067

Please sign in to comment.