More transform(...) filter cleanup using mem_fn when possible
This commit is contained in:
parent
8b6eba8208
commit
780a4605fa
|
@ -67,8 +67,7 @@ void register_env_vars()
|
|||
"buflist", false,
|
||||
[](StringView name, const Context& context)
|
||||
{ return join(BufferManager::instance() |
|
||||
transform([](const std::unique_ptr<Buffer>& b)
|
||||
{ return b->display_name(); }), ':'); }
|
||||
transform(std::mem_fn(&Buffer::display_name)), ':'); }
|
||||
}, {
|
||||
"timestamp", false,
|
||||
[](StringView name, const Context& context) -> String
|
||||
|
|
|
@ -119,8 +119,7 @@ CandidateList OptionsRegistry::complete_option_name(StringView prefix,
|
|||
return complete(prefix, cursor_pos, m_descs |
|
||||
filter([](const OptionPtr& desc)
|
||||
{ return not (desc->flags() & OptionFlags::Hidden); }) |
|
||||
transform([](const OptionPtr& desc) -> const String&
|
||||
{ return desc->name(); }));
|
||||
transform(std::mem_fn(&OptionDesc::name)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -610,9 +610,7 @@ String selection_to_string(const Selection& selection)
|
|||
|
||||
String selection_list_to_string(const SelectionList& selections)
|
||||
{
|
||||
return join(selections | transform([](const Selection& s)
|
||||
{ return selection_to_string(s); }),
|
||||
':', false);
|
||||
return join(selections | transform(selection_to_string), ':', false);
|
||||
}
|
||||
|
||||
Selection selection_from_string(StringView desc)
|
||||
|
|
Loading…
Reference in New Issue
Block a user