-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
C-Code-QualityA section of code that is hard to understand or changeA section of code that is hard to understand or changeC-PerformanceA change motivated by improving speed, memory usage or compile timesA change motivated by improving speed, memory usage or compile times
Description
Bevy version
What you did
I read the documentation of ExactSizeIterator, and notice that this requirement isn't true:
When implementing an ExactSizeIterator, you must also implement Iterator.
When doing so, the implementation of Iterator::size_hint must return the exact size of the iterator.
In the standard implementation this is checked with an assertion.
Instead of providing an exact size_hint, Bevy overrides that function, which removes the need for that invariant to be true.
While it isn't a problem here, it would still be nice if QueryIter would provide an exact size_hint if it can.
alice-i-cecile
Metadata
Metadata
Assignees
Labels
C-Code-QualityA section of code that is hard to understand or changeA section of code that is hard to understand or changeC-PerformanceA change motivated by improving speed, memory usage or compile timesA change motivated by improving speed, memory usage or compile times