bevy/crates
James Liu 2c93b5cf73 Reduce code duplication by using QueryIterationCursor in QueryIter (#4733)
# Objective
We have duplicated code between `QueryIter` and `QueryIterationCursor`. Reuse that code.

## Solution
 - Reuse `QueryIterationCursor` inside `QueryIter`.
 - Slim down `QueryIter` by removing the `&'w World`. It was only being used by the `size_hint` and `ExactSizeIterator` impls, which can use the QueryState and &Archetypes in the type already.
 - Benchmark to make sure there is no significant regression.

Relevant benchmark results seem to show that there is no tangible difference between the two. Everything seems to be either identical or within a workable margin of error here.

```
group                                          embed-cursor                            main
-----                                          ------------                            ----
fragmented_iter/base                           1.00   387.4±19.70ns        ? ?/sec     1.07   413.1±27.95ns        ? ?/sec
many_maps_iter                                 1.00     27.3±0.22ms        ? ?/sec     1.00     27.4±0.10ms        ? ?/sec
simple_iter/base                               1.00     13.8±0.07µs        ? ?/sec     1.00     13.7±0.17µs        ? ?/sec
simple_iter/sparse                             1.00     61.9±0.37µs        ? ?/sec     1.00     62.2±0.64µs        ? ?/sec
simple_iter/system                             1.00     13.7±0.34µs        ? ?/sec     1.00     13.7±0.10µs        ? ?/sec
sparse_fragmented_iter/base                    1.00     11.0±0.54ns        ? ?/sec     1.03     11.3±0.48ns        ? ?/sec
world_query_iter/50000_entities_sparse         1.08    105.0±2.68µs        ? ?/sec     1.00     97.5±2.18µs        ? ?/sec
world_query_iter/50000_entities_table          1.00     27.3±0.13µs        ? ?/sec     1.00     27.3±0.37µs        ? ?/sec
```
2022-05-18 18:34:52 +00:00
..
bevy_animation Make AnimationClip::duration return value instead of reference (#4617) 2022-04-27 23:44:06 +00:00
bevy_app exact sized event iterators (#3863) 2022-05-09 13:19:32 +00:00
bevy_asset Update ndk-glue requirement from 0.5 to 0.6 (#3624) 2022-05-16 18:32:26 +00:00
bevy_audio Add missing audio/ogg file extensions: .oga, .spx (#4703) 2022-05-09 13:37:40 +00:00
bevy_core add #[reflect(Default)] to create default value for reflected types (#3733) 2022-05-03 19:20:13 +00:00
bevy_core_pipeline Do not create nor execute render passes which have no phase items to draw (#4643) 2022-05-02 20:22:30 +00:00
bevy_crevice Bump Bevy to 0.8.0-dev (#4505) 2022-04-17 23:04:52 +00:00
bevy_derive Decouple some dependencies (#3886) 2022-04-27 19:08:11 +00:00
bevy_diagnostic Fix frame count being a float (#4493) 2022-05-17 04:01:54 +00:00
bevy_dylib Bump Bevy to 0.8.0-dev (#4505) 2022-04-17 23:04:52 +00:00
bevy_dynamic_plugin Bump Bevy to 0.8.0-dev (#4505) 2022-04-17 23:04:52 +00:00
bevy_ecs Reduce code duplication by using QueryIterationCursor in QueryIter (#4733) 2022-05-18 18:34:52 +00:00
bevy_ecs_compile_fail_tests Make derived SystemParam readonly if possible (#4650) 2022-05-09 16:09:33 +00:00
bevy_gilrs Change gamepad.rs tuples to normal structs (#4519) 2022-05-02 13:20:55 +00:00
bevy_gltf Fixing confusing near and far fields in Camera (#4457) 2022-05-16 16:37:33 +00:00
bevy_hierarchy Support returning data out of with_children (#4708) 2022-05-17 22:37:51 +00:00
bevy_input Update keyboard.rs docs in bevy_input (#4517) 2022-05-17 04:16:54 +00:00
bevy_internal Update ndk-glue requirement from 0.5 to 0.6 (#3624) 2022-05-16 18:32:26 +00:00
bevy_log can specify chrome tracing file (#4618) 2022-05-03 15:35:04 +00:00
bevy_macro_utils bevy_reflect_derive: Tidying up the code (#4712) 2022-05-12 19:43:23 +00:00
bevy_math Document bevy_math (#4591) 2022-04-26 18:23:29 +00:00
bevy_pbr Fixing confusing near and far fields in Camera (#4457) 2022-05-16 16:37:33 +00:00
bevy_ptr bevy_ptr works in no_std environments (#4760) 2022-05-16 17:45:10 +00:00
bevy_reflect bevy_reflect: Small refactor and default Reflect methods (#4739) 2022-05-18 12:26:11 +00:00
bevy_render Nightly clippy fixes (#3491) 2022-05-17 04:38:03 +00:00
bevy_scene Bump Bevy to 0.8.0-dev (#4505) 2022-04-17 23:04:52 +00:00
bevy_sprite Fixing confusing near and far fields in Camera (#4457) 2022-05-16 16:37:33 +00:00
bevy_tasks Remove unused CountdownEvent (#4290) 2022-04-26 21:20:12 +00:00
bevy_text Update layout/style when scale factor changes too (#4689) 2022-05-09 14:18:02 +00:00
bevy_transform Nightly clippy fixes (#3491) 2022-05-17 04:38:03 +00:00
bevy_ui Fix mouse_clicked check for touches. (#2029) 2022-05-16 18:00:08 +00:00
bevy_utils Make public macros more robust with $crate (#4655) 2022-05-06 19:29:45 +00:00
bevy_window Allow closing windows at runtime (#3575) 2022-05-05 13:35:43 +00:00
bevy_winit Allow closing windows at runtime (#3575) 2022-05-05 13:35:43 +00:00