On 19 February 2012 17:14, Andreas Färber <afaer...@suse.de> wrote:
> Am 19.02.2012 17:04, schrieb Alexander Barabash:
>> +    return g_strndup(&type[sizeof(LINK_PROPERTY_TYPE_PREFIX) - 1],
>> +                     strlen(type)
>> +                     - (sizeof(LINK_PROPERTY_TYPE_PREFIX) - 1)
>> +                     - (sizeof(LINK_PROPERTY_TYPE_SUFFIX) - 1));
>
> Any reason not to use strlen()? I don't think this is a hot path, and
> repeated sizeof() - 1 does not read so nice.

gcc will optimise away strlen("constant string") at compile time anyway,
so there really is no need to avoid it.

-- PMM

Reply via email to