Skip to content

Commit

Permalink
feat: optimize __next__ of TasksIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
Sciator committed Nov 21, 2023
1 parent bfa54a4 commit f72b3cc
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions influxdb_client/client/tasks_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@ class TasksIterator:
def __init__(self, values, next) -> None:
self.values = values
self.next = next
self.no_values = False if values else True

def __iter__(self):
return self
return self if self.values else (_ for _ in ())

def __next__(self):
if self.no_values:
raise StopIteration
if not self.values:
self.values, self.next = self.next()
if not self.values:
Expand Down

0 comments on commit f72b3cc

Please sign in to comment.