Removing the debug log message allows to get rid of three
local variables and an allocation.
result = para_malloc((NUM_MAPPED_KEYS + 1) * sizeof(char *));
FOR_EACH_MAPPED_KEY(i) {
- int idx = get_key_map_idx(i);
char *seq = get_key_map_seq(i);
- char *cmd = get_key_map_cmd(i);
- bool internal = is_internal_key(i);
- PARA_DEBUG_LOG("%s key sequence #%d: %s -> %s\n",
- internal? "internal" : "user-defined",
- idx, seq, cmd);
result[i] = seq;
- free(cmd);
}
result[i] = NULL;
return result;