Skip to content

Commit 5d1b13e

Browse files
TheAtomicOptiondpkp
authored andcommitted
changed for to use enumerate() (#1301)
1 parent 141b6b2 commit 5d1b13e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

kafka/conn.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,13 +747,12 @@ def recv(self):
747747
return ()
748748

749749
# augment respones w/ correlation_id, future, and timestamp
750-
for i in range(len(responses)):
750+
for i, response in enumerate(responses):
751751
(correlation_id, future, timestamp) = self.in_flight_requests.popleft()
752752
latency_ms = (time.time() - timestamp) * 1000
753753
if self._sensors:
754754
self._sensors.request_time.record(latency_ms)
755755

756-
response = responses[i]
757756
log.debug('%s Response %d (%s ms): %s', self, correlation_id, latency_ms, response)
758757
responses[i] = (response, future)
759758

0 commit comments

Comments
 (0)