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

View File

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