Skip to content

Commit

Permalink
Update iterator to reflect the new __has_next__()
Browse files Browse the repository at this point in the history
Signed-off-by: rd4com <[email protected]>
  • Loading branch information
rd4com committed Nov 8, 2024
1 parent d9389c7 commit a3f0e72
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stdlib/src/builtin/object.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -2489,11 +2489,11 @@ struct _ObjectIter[
raise "Error in _ObjectIter.__next__"

@always_inline
fn __hasmore__(self) -> Bool:
fn __has_next__(self) -> Bool:
if self.hint_type == Self.list_iter_hint:
return self.iterator[Self.list_iter].__hasmore__()
return self.iterator[Self.list_iter].__has_next__()
if self.hint_type == Self.dict_iter_hint:
return self.iterator[Self.dict_iter].__hasmore__()
return self.iterator[Self.dict_iter].__has_next__()
return False

fn __len__(self) raises -> Int:
Expand Down

0 comments on commit a3f0e72

Please sign in to comment.