From d748b0e67103d23cb42facc90cfafc8f863e5ca0 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Sun, 16 May 2021 00:51:16 +0200 Subject: [PATCH] remove state::get_idents this was never going to be good from API standpoint, and is no longer necessary (can use ident_count + get_ident by index with a loop, for example) --- include/cubescript/cubescript/state.hh | 6 ------ src/cs_state.cc | 13 ------------- 2 files changed, 19 deletions(-) diff --git a/include/cubescript/cubescript/state.hh b/include/cubescript/cubescript/state.hh index b9c3520..1b009a6 100644 --- a/include/cubescript/cubescript/state.hh +++ b/include/cubescript/cubescript/state.hh @@ -389,12 +389,6 @@ struct LIBCUBESCRIPT_EXPORT state { ); } - /** @brief Get a span of all idents */ - span_type get_idents(); - - /** @brief Get a span of all idents */ - span_type get_idents() const; - /** @brief Compile a string. * * This compiles the given string, optionally using `source` as a filename diff --git a/src/cs_state.cc b/src/cs_state.cc index b70f14b..1782eaf 100644 --- a/src/cs_state.cc +++ b/src/cs_state.cc @@ -346,19 +346,6 @@ LIBCUBESCRIPT_EXPORT ident const &state::get_ident(std::size_t index) const { return *p_tstate->istate->identmap[index]; } - -LIBCUBESCRIPT_EXPORT span_type state::get_idents() { - return span_type{ - p_tstate->istate->identmap.data(), - p_tstate->istate->identmap.size() - }; -} - -LIBCUBESCRIPT_EXPORT span_type state::get_idents() const { - auto ptr = const_cast(p_tstate->istate->identmap.data()); - return span_type{ptr, p_tstate->istate->identmap.size()}; -} - LIBCUBESCRIPT_EXPORT void state::clear_override(ident &id) { if (!id.is_overridden(*this)) { return;