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
|
* The separator is arbitrary. When the separator is NULL, a single space will
|
||||||
* be used.
|
* be used.
|
||||||
*/
|
*/
|
||||||
char *str_join(const char *const parts[],
|
char *str_join(const char *const parts[], const char *fmt, const char *sep);
|
||||||
const char *restrict fmt, const char *restrict sep);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* str_endswith - indicate whether a string ends with a given suffix
|
* str_endswith - indicate whether a string ends with a given suffix
|
||||||
|
|
|
||||||
|
|
@ -93,8 +93,7 @@ strdup_printf(const char *fmt, ...)
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
str_join(const char *const parts[],
|
str_join(const char *const parts[], const char *fmt, const char *sep)
|
||||||
const char *restrict fmt, const char *restrict sep)
|
|
||||||
{
|
{
|
||||||
assert(parts);
|
assert(parts);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue