Tweak id_map implementation
This commit is contained in:
parent
79de7ee717
commit
c17fa7be14
|
@ -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;
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user