Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for EntityIterator and IndicesIterator #5

Merged
merged 1 commit into from
Mar 23, 2021

Conversation

c42f
Copy link
Contributor

@c42f c42f commented Mar 15, 2021

  • IteratorSize(::IndicesIterator) set to SizeUnknown, as it involves a
    predicate which filters out an unknown number of elements.
  • IteratorSize(::EntityIterator) defers to the wrapped iterator
  • Implement eltype(::EntityIterator) so that collect() is type stable

Fixes #4

* IteratorSize(::IndicesIterator) set to SizeUnknown, as it involves a
  predicate which filters out an unknown number of elements.
* IteratorSize(::EntityIterator) defers to the wrapped iterator
* Implement eltype(::EntityIterator) so that collect() is type stable
@louisponet
Copy link
Owner

Thank you! I didn't know about Base.IteratorSize and SizeUnknown. Indeed you are right, assigning an actual iterator length to iterators with a test function is not correct.

@louisponet louisponet merged commit d40d18c into louisponet:master Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

collect(@entities_in(...)) is type unstable and can return #undef elements
2 participants