Implement strcasecmp to avoid creating an uppercase copy
Griezn opened this issue · 1 comments
Griezn commented
When working on issue #437 I noticed that stumpless_get_facility_enum_from_buffer
and 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 commented
I think this is a great idea, and certainly something you should feel free to implement!