Skip to content

refactor(debug): Rename and simplify GetAsciiNetCommandType() #1377

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

Merged
merged 1 commit into from
Jul 30, 2025

Conversation

Mauller
Copy link

@Mauller Mauller commented Jul 28, 2025

This PR refactors a function to optimise it's internal behaviour and to return c strings instead of ascii strings.

The function internally allocated ascii strings for them to be turned back into c strings externally.
It also used a block of if else if statements to check and return the relevant string.

This was refactored to instead return c strings and to use a switch internally.

I also re-ordered the case statements to match the ordering of the enumeration the values belong to.

@Mauller Mauller self-assigned this Jul 28, 2025
@Mauller Mauller added Minor Severity: Minor < Major < Critical < Blocker Performance Is a performance concern Gen Relates to Generals ZH Relates to Zero Hour Refactor Edits the code with insignificant behavior changes, is never user facing Debug Is mostly debug functionality labels Jul 28, 2025
@xezon xezon changed the title refactor(debug): rename GetAsciiNetCommandType to GetNetCommandTypeAsString and internally change it to use a switch and to return c strings refactor(debug): Rename GetAsciiNetCommandType to GetNetCommandTypeAsString and change it to use a switch and return C strings Jul 28, 2025
…String and internally change it to use a switch and to return c strings
@Mauller Mauller force-pushed the refactor-getnetcommandasstring branch from 6f6f640 to e28d7b6 Compare July 29, 2025 21:44
@Mauller
Copy link
Author

Mauller commented Jul 29, 2025

Added debug crash to default case, should be good now.

@xezon xezon changed the title refactor(debug): Rename GetAsciiNetCommandType to GetNetCommandTypeAsString and change it to use a switch and return C strings refactor(debug): Rename and simplify GetAsciiNetCommandType() Jul 30, 2025
@xezon xezon merged commit 9aa57e8 into TheSuperHackers:main Jul 30, 2025
15 checks passed
@xezon xezon deleted the refactor-getnetcommandasstring branch July 30, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Debug Is mostly debug functionality Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker Performance Is a performance concern Refactor Edits the code with insignificant behavior changes, is never user facing ZH Relates to Zero Hour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants