Initializing a char array to "" is equivalent to a memset()
call - which is exactly what it gets compiled to.
Fixing this one callsite reduced memset() _user_ cpu cycles
from 2-4% to 0.05% on the EeePC.
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
char attr[UTIL_PATH_SIZE];
const char *key_name = &rules->buf[cur->key.attr_off];
const char *key_value = &rules->buf[cur->key.value_off];
- char value[UTIL_NAME_SIZE] = "";
+ char value[UTIL_NAME_SIZE];
size_t len;
util_strlcpy(attr, key_name, sizeof(attr));
+ util_strlcpy(value, "", sizeof(value));
util_resolve_subsys_kernel(event->udev, attr, value, sizeof(value), 1);
if (value[0] == '\0') {
const char *val;