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

Port - Optimized ISODD/ISEVEN #28208

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

Vi3trice
Copy link
Contributor

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

math

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

  • I confirm that I either do not require pre-approval for this PR, or I have obtained such approval and have included a screenshot to demonstrate this below.

Changelog

NPFC

@ParadiseSS13-Bot ParadiseSS13-Bot added the -Status: Awaiting type assignment This PR is waiting for its type to be assigned internally label Jan 31, 2025
@ParadiseSS13-Bot ParadiseSS13-Bot added -Status: Awaiting review This PR is awaiting review from the review team and removed -Status: Awaiting type assignment This PR is waiting for its type to be assigned internally labels Feb 2, 2025
@lewcc
Copy link
Contributor

lewcc commented Feb 4, 2025

I wonder if it might make sense to add a CI check against this

Copy link
Member

@chuga-git chuga-git left a comment

Choose a reason for hiding this comment

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

LGTM.

@ParadiseSS13-Bot ParadiseSS13-Bot added -Status: Awaiting merge This PR is ready for merge and removed -Status: Awaiting review This PR is awaiting review from the review team labels Feb 12, 2025
Copy link
Member

@DGamerL DGamerL left a comment

Choose a reason for hiding this comment

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

No giant switch case, sad

@DGamerL DGamerL added this pull request to the merge queue Feb 12, 2025
Merged via the queue into ParadiseSS13:master with commit baad313 Feb 12, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Status: Awaiting merge This PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants