Closed davidpdrsn closed 1 year ago
Currently most iterators like Struct::fields is defined as:
Struct::fields
pub struct PairIter<'a, T = str> where T: ?Sized, { iter: Box<dyn Iterator<Item = (&'a T, &'a dyn Reflect)> + 'a>, }
which requires allocating. That could be optimized. We could do that bevy_reflect does where traits have a field_at(index) and fields_len methods.
field_at(index)
fields_len
Currently most iterators like
Struct::fields
is defined as:which requires allocating. That could be optimized. We could do that bevy_reflect does where traits have a
field_at(index)
andfields_len
methods.