Test entity labels, fixed corner cases, changed interface#1152
Merged
cart merged 2 commits intobevyengine:masterfrom Dec 28, 2020
Merged
Test entity labels, fixed corner cases, changed interface#1152cart merged 2 commits intobevyengine:masterfrom
cart merged 2 commits intobevyengine:masterfrom
Conversation
Closed
3c5d09e to
10c92af
Compare
Member
|
as mentioned here, you shouldn't use goods to have more tests! |
10c92af to
a42b498
Compare
* add tests for entity_labels_system * fixed filling label_entities map * fixed corner cases when removing entities, Labels component * changed EntityLabels::get to return slice or empty slice instead of None or Some empty or non-empty slice Changing the interface of EntityLabels::get is beneficial, since else you would get different results in case there was an entity before that with this missing label or not. You would either get None or Some(&[]) and need to handle both, which is actually not necessary.
a42b498 to
5ef60dc
Compare
Member
|
Yup this seems good to me. We should be able to add Changed filters using this approach:
Without Changed filters, the current implementation is expensive in a "very hard to justify" sort of way. (which isn't a critique of this pr. this is a critique of past @cart back when he was just building things for himself) |
Member
|
Feel free to follow up with those changes (or I will if nobody else does). No harm in merging these fixes now. |
This was referenced Dec 28, 2020
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
None or Some empty or non-empty slice
Changing the interface of EntityLabels::get is beneficial, since else
you would get different results in case there was an entity before that
with this missing label or not. You would either get None or Some(&[])
and need to handle both, which is actually not necessary.