Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix load_resource stops proceeding if any of asset loading failed #293

Merged
merged 4 commits into from
Sep 4, 2024

Conversation

akimakinai
Copy link
Contributor

Vec::pop/Vec::push touches only the last element of Vec. So, if the asset there failed to load, load_resource_assets wouldn't process remaining asset any more. This PR changes it to use VecDeque::push_back/VecDeque::pop_front instead.

@janhohenheim
Copy link
Member

@cart looks like your code made it back in :D
Could you add a comment explaining why we are using a VecDeque and not a Vec? lgtm otherwise.

Copy link
Collaborator

@benfrankel benfrankel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug and fix seem correct to me from the code. Approved, but deferring to @janhohenheim's review before merging.

Thanks for fixing this :)

src/asset_tracking.rs Outdated Show resolved Hide resolved
Co-authored-by: Ben Frankel <[email protected]>
Copy link
Member

@janhohenheim janhohenheim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took the liberty of applying @benfrankel's suggestion ;)

@janhohenheim janhohenheim enabled auto-merge (squash) September 4, 2024 18:30
@janhohenheim janhohenheim merged commit 84ca612 into TheBevyFlock:main Sep 4, 2024
4 checks passed
@akimakinai akimakinai deleted the asset_tracking_queue branch September 5, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants