Port - Optimized ISODD/ISEVEN #28208
Merged
+14
−14
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.
What Does This PR Do
Ports BeeStation/BeeStation-Hornet#10504
The tl;dr of it is that doing a modulo calculation to see if a number is odd/even is expensive, when you can just check the first bit for the same result. This also replaces all
mod 2
evaluations with the defines as there were some confusing usage of it. Some places make very frequent use of it.Why It's Good For The Game
Faster, makes me not go insane.
Images of changes
Testing
https://discord.com/channels/145533722026967040/727448459862343711/1334903958577348742
Ran a session and checked the files that had changes (i.e. mob atmos, safe cracking, footsteps, etc)
Declaration
Changelog
NPFC