Tweak id_map implementation

This commit is contained in:
Maxime Coste 2014-12-23 22:15:25 +00:00
parent 79de7ee717
commit c17fa7be14
2 changed files with 6 additions and 4 deletions

View File

@ -51,6 +51,8 @@ struct FilteredIterator : std::iterator<std::forward_iterator_tag,
return not (lhs == rhs);
}
Iterator base() const { return m_it; }
private:
void do_filter()
{
@ -105,6 +107,8 @@ struct TransformedIterator : std::iterator<std::forward_iterator_tag,
return not (lhs == rhs);
}
Iterator base() const { return m_it; }
private:
Iterator m_it;
Transform m_transform;

View File

@ -33,14 +33,12 @@ public:
iterator find(StringView id)
{
return find_if(m_content,
[&](const value_type& v){ return v.first == id; });
return Kakoune::find(transformed(m_content, get_id), id).base();
}
const_iterator find(StringView id) const
{
return find_if(m_content,
[&](const value_type& v){ return v.first == id; });
return Kakoune::find(transformed(m_content, get_id), id).base();
}
bool contains(StringView id) const