From 1c56ea36ffb9d281d41f649d09882fb3ed5bb1fe Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 7 May 2021 01:13:02 +0200 Subject: [PATCH] remove save_val --- src/cs_ident.cc | 7 ++----- src/cs_ident.hh | 2 -- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/cs_ident.cc b/src/cs_ident.cc index 13fdf77..cb99445 100644 --- a/src/cs_ident.cc +++ b/src/cs_ident.cc @@ -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(p_impl)->save_val(); + auto *imp = static_cast(p_impl); + imp->p_override = std::move(imp->p_storage); p_impl->p_flags |= IDENT_FLAG_OVERRIDDEN; } } else { diff --git a/src/cs_ident.hh b/src/cs_ident.hh index 852f407..a5aef29 100644 --- a/src/cs_ident.hh +++ b/src/cs_ident.hh @@ -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{};