Skip to content

Commit 7f1db1d

Browse files
committed
reduce memory copies when consuming kafka responses
1 parent a306687 commit 7f1db1d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

kafka/conn.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,9 @@ def __str__(self):
3838

3939
def _consume_response(self):
4040
"""
41-
Fully consumer the response iterator
41+
Fully consume the response iterator
4242
"""
43-
data = ""
44-
for chunk in self._consume_response_iter():
45-
data += chunk
46-
return data
43+
return "".join(self._consume_response_iter())
4744

4845
def _consume_response_iter(self):
4946
"""

0 commit comments

Comments
 (0)