diff --git a/src/option_manager.cc b/src/option_manager.cc index d842a254..b3c56d31 100644 --- a/src/option_manager.cc +++ b/src/option_manager.cc @@ -48,13 +48,13 @@ struct option_not_found : public runtime_error Option& OptionManager::get_local_option(StringView name) { - auto it = find_option(m_options, name); + auto it = m_options.find(name); if (it != m_options.end()) - return **it; + return *(it->value); else if (m_parent) { - m_options.emplace_back((*m_parent)[name].clone(*this)); - return *m_options.back(); + auto* clone = (*m_parent)[name].clone(*this); + return *m_options.insert({clone->name(), std::unique_ptr