remove save_val

master
Daniel Kolesa 2021-05-07 01:13:02 +02:00
parent 9437e0951b
commit 1c56ea36ff
2 changed files with 2 additions and 7 deletions

View File

@ -84,10 +84,6 @@ void var_changed(thread_state &ts, builtin_var &id, any_value &oldval) {
}, val[0]);
}
void var_impl::save_val() {
p_override = std::move(p_storage);
}
command *var_impl::get_setter(thread_state &ts) const {
switch (p_storage.type()) {
case value_type::INTEGER:
@ -239,7 +235,8 @@ LIBCUBESCRIPT_EXPORT void builtin_var::save(state &cs) {
};
}
if (!(p_impl->p_flags & IDENT_FLAG_OVERRIDDEN)) {
static_cast<var_impl *>(p_impl)->save_val();
auto *imp = static_cast<var_impl *>(p_impl);
imp->p_override = std::move(imp->p_storage);
p_impl->p_flags |= IDENT_FLAG_OVERRIDDEN;
}
} else {

View File

@ -76,8 +76,6 @@ bool ident_is_callable(ident const *id);
struct var_impl: ident_impl, builtin_var {
var_impl(string_ref name, int flags);
void save_val();
command *get_setter(thread_state &ts) const;
any_value p_storage{};