Fix face completion, avoid a spurious temporary

This commit is contained in:
Maxime Coste 2016-02-12 19:14:06 +00:00
parent 0fc0702983
commit 6f65f4b3a5
2 changed files with 3 additions and 3 deletions

View File

@ -94,10 +94,9 @@ void FaceRegistry::register_alias(const String& name, const String& facedesc,
CandidateList FaceRegistry::complete_alias_name(StringView prefix,
ByteCount cursor_pos) const
{
using ValueType = std::pair<String, FaceOrAlias>;
return complete(prefix, cursor_pos,
transformed(m_aliases,
[](const ValueType& v) -> const String&
[](const AliasMap::value_type& v) -> const String&
{ return v.first; }));
}

View File

@ -29,7 +29,8 @@ private:
FaceOrAlias(Face face = Face{}) : face(face) {}
};
UnorderedMap<String, FaceOrAlias, MemoryDomain::Faces> m_aliases;
using AliasMap = UnorderedMap<String, FaceOrAlias, MemoryDomain::Faces>;
AliasMap m_aliases;
};
inline Face get_face(const String& facedesc)