string-helpers: remove restrict qualifier

'restrict' is harmful as it encourages the compiler to make dangerous
assumptions while increasing cognitive load on the human programmer.

The extra 1% (or whatever) of performance here is not worth the cost.
This commit is contained in:
John Lindgren 2025-07-04 00:15:56 -04:00 committed by Consolatis
parent 681f9e9a7b
commit 407a29aa23
2 changed files with 2 additions and 4 deletions

View file

@ -59,8 +59,7 @@ char *strdup_printf(const char *fmt, ...);
* The separator is arbitrary. When the separator is NULL, a single space will
* be used.
*/
char *str_join(const char *const parts[],
const char *restrict fmt, const char *restrict sep);
char *str_join(const char *const parts[], const char *fmt, const char *sep);
/**
* str_endswith - indicate whether a string ends with a given suffix

View file

@ -93,8 +93,7 @@ strdup_printf(const char *fmt, ...)
}
char *
str_join(const char *const parts[],
const char *restrict fmt, const char *restrict sep)
str_join(const char *const parts[], const char *fmt, const char *sep)
{
assert(parts);