bevy/crates
BD103 04ceb46fe0
Use EntityHashMap for EntityMapper (#10415)
# Objective

- There is a specialized hasher for entities:
[`EntityHashMap`](https://docs.rs/bevy/latest/bevy/utils/type.EntityHashMap.html)
- [`EntityMapper`] currently uses a normal `HashMap<Entity, Entity>`
- Fixes #10391

## Solution

- Replace the normal `HashMap` with the more performant `EntityHashMap`

## Questions

- This does change public API. Should a system be implemented to help
migrate code?
  - Perhaps an `impl From<HashMap<K, V, S>> for EntityHashMap<K, V>`
- I updated to docs for each function that I changed, but I may have
missed something

---

## Changelog

- Changed `EntityMapper` to use `EntityHashMap` instead of normal
`HashMap`

## Migration Guide

If you are using the following types, update their listed methods to use
the new `EntityHashMap`. `EntityHashMap` has the same methods as the
normal `HashMap`, so you just need to replace the name.

### `EntityMapper`

- `get_map`
- `get_mut_map`
- `new`
- `world_scope`

### `ReflectMapEntities`

- `map_all_entities`
- `map_entities`
- `write_to_world`

### `InstanceInfo`

- `entity_map`
  - This is a property, not a method.

---

This is my first time contributing in a while, and I'm not familiar with
the usage of `EntityMapper`. I changed the type definition and fixed all
errors, but there may have been things I've missed. Please keep an eye
out for me!
2023-11-07 08:23:04 +00:00
..
bevy_a11y Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_animation Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_app Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_asset Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_audio Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_core Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_core_pipeline Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_derive Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_diagnostic Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_dylib Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_dynamic_plugin Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_ecs Use EntityHashMap for EntityMapper (#10415) 2023-11-07 08:23:04 +00:00
bevy_ecs_compile_fail_tests Updates for rust 1.73 (#10035) 2023-10-06 00:31:10 +00:00
bevy_encase_derive Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_gilrs Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_gizmos Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_gltf Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_hierarchy Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_input Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_internal Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_log Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_macro_utils Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_macros_compile_fail_tests bevy_derive: Fix #[deref] breaking other attributes (#9551) 2023-08-28 17:36:18 +00:00
bevy_math Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_mikktspace Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_pbr Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_ptr Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_reflect Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_reflect_compile_fail_tests Improve TypeUuid's derive macro error messages (#9315) 2023-10-02 12:42:01 +00:00
bevy_render Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_scene Use EntityHashMap for EntityMapper (#10415) 2023-11-07 08:23:04 +00:00
bevy_sprite Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_tasks Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_text Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_time docs: use read instead of deprecated iter (#10376) 2023-11-05 02:03:42 +00:00
bevy_transform Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_ui ui material: fix right border width (#10421) 2023-11-07 01:54:34 +00:00
bevy_utils Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_window Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_winit Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00