OptionDescs are const in OptionRegistry
This commit is contained in:
parent
5e3effc1f0
commit
a0c20a924a
|
@ -115,7 +115,7 @@ void OptionManager::on_option_changed(const Option& option)
|
|||
CandidateList OptionsRegistry::complete_option_name(StringView prefix,
|
||||
ByteCount cursor_pos) const
|
||||
{
|
||||
using OptionPtr = std::unique_ptr<OptionDesc>;
|
||||
using OptionPtr = std::unique_ptr<const OptionDesc>;
|
||||
return complete(prefix, cursor_pos, m_descs |
|
||||
filter([](const OptionPtr& desc)
|
||||
{ return not (desc->flags() & OptionFlags::Hidden); }) |
|
||||
|
|
|
@ -234,7 +234,7 @@ public:
|
|||
const OptionDesc* option_desc(StringView name) const
|
||||
{
|
||||
auto it = find_if(m_descs,
|
||||
[&name](const std::unique_ptr<OptionDesc>& opt)
|
||||
[&name](const std::unique_ptr<const OptionDesc>& opt)
|
||||
{ return opt->name() == name; });
|
||||
return it != m_descs.end() ? it->get() : nullptr;
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ public:
|
|||
CandidateList complete_option_name(StringView prefix, ByteCount cursor_pos) const;
|
||||
private:
|
||||
OptionManager& m_global_manager;
|
||||
Vector<std::unique_ptr<OptionDesc>, MemoryDomain::Options> m_descs;
|
||||
Vector<std::unique_ptr<const OptionDesc>, MemoryDomain::Options> m_descs;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user