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

cleanup: Game::checkCreatures #3020

Merged
merged 4 commits into from
Oct 29, 2024
Merged

cleanup: Game::checkCreatures #3020

merged 4 commits into from
Oct 29, 2024

Conversation

mehah
Copy link
Contributor

@mehah mehah commented Oct 25, 2024

The loop by iterator has been replaced by erase_if, as it is visually cleaner and more intuitive. In terms of performance, there was not much gain, as both use object reallocation, perhaps a slight improvement, as erase_if uses std::move to reallocate the last object.

A dead code that is never called has also been removed, as this code is already called by Creature::changeHealth on line 892

Dead Code

	afterCreatureZoneChange(creature, creature->getZones(), {});
	creature->onDeath();

@dudantas dudantas force-pushed the cleanup_checkcreatures branch 2 times, most recently from a31f166 to 39eea8e Compare October 27, 2024 21:58
@dudantas dudantas changed the title cleanup: checkCreatures improve: cleanup Game::checkCreatures Oct 27, 2024
Copy link

@dudantas dudantas changed the title improve: cleanup Game::checkCreatures cleanup: Game::checkCreatures Oct 28, 2024
@dudantas
Copy link
Member

It has been tested in production with 80 players in production, everything seems ok.

@dudantas dudantas merged commit 9c4b134 into main Oct 29, 2024
36 checks passed
@dudantas dudantas deleted the cleanup_checkcreatures branch October 29, 2024 13:31
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.

2 participants