mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
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:
parent
681f9e9a7b
commit
407a29aa23
2 changed files with 2 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue