mirror of https://github.com/mpv-player/mpv
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:
parent
8d5f8d5a6b
commit
cfc72d4fff
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue