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

Implement strcasecmp to avoid creating an uppercase copy #438

Closed
Griezn opened this issue Aug 21, 2024 · 1 comment
Closed

Implement strcasecmp to avoid creating an uppercase copy #438

Griezn opened this issue Aug 21, 2024 · 1 comment
Labels
refactor changes that require refactoring of existing code

Comments

@Griezn
Copy link
Contributor

Griezn commented Aug 21, 2024

When working on issue #437 I noticed that stumpless_get_facility_enum_from_bufferand stumpless_get_severity_enum_from_buffer create a copy of the parameter and then convert that copy to uppercase to compare.

As a solution I suggest implementing the strcasecomp function which performs a case-insensitive compare. And use this function to directly compare the parameter instead of its copy thus further reducing allocations and improving speed.

Maybe I am forgetting something, let me know!

@goatshriek goatshriek added the refactor changes that require refactoring of existing code label Aug 21, 2024
@goatshriek
Copy link
Owner

I think this is a great idea, and certainly something you should feel free to implement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor changes that require refactoring of existing code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants