1
mirror of https://github.com/mpv-player/mpv synced 2024-08-04 14:59:58 +02:00

m_config: slightly simplify dynamic option initialization

We can assume memcpy is enough, because the source should be from
static data. (It wouldn't work if the data could contain pointers
back into itself.)
This commit is contained in:
wm4 2013-10-24 19:15:16 +02:00
parent 8d5f8d5a6b
commit cfc72d4fff

View File

@ -427,10 +427,9 @@ static struct m_config_option *m_config_add_option(struct m_config *config,
assert(0);
}
union m_option_value temp = {0};
m_option_copy(arg, &temp, co->data);
memcpy(&temp, co->data, arg->type->size);
memset(co->data, 0, arg->type->size);
m_option_copy(arg, co->data, &temp);
m_option_free(arg, &temp);
}
}
}