Add some more force inlines to some buffer methods
This commit is contained in:
parent
6c581b7054
commit
50abc18c8e
|
@ -177,9 +177,11 @@ private:
|
|||
|
||||
struct LineList : std::vector<String>
|
||||
{
|
||||
[[gnu::always_inline]]
|
||||
String& operator[](LineCount line)
|
||||
{ return std::vector<String>::operator[]((int)line); }
|
||||
|
||||
[[gnu::always_inline]]
|
||||
const String& operator[](LineCount line) const
|
||||
{ return std::vector<String>::operator[]((int)line); }
|
||||
};
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
namespace Kakoune
|
||||
{
|
||||
|
||||
[[gnu::always_inline]]
|
||||
inline char Buffer::byte_at(ByteCoord c) const
|
||||
{
|
||||
kak_assert(c.line < line_count() and c.column < m_lines[c.line].length());
|
||||
|
@ -82,6 +83,7 @@ inline BufferIterator Buffer::end() const
|
|||
return BufferIterator(*this, { line_count() - 1, m_lines.back().length() });
|
||||
}
|
||||
|
||||
[[gnu::always_inline]]
|
||||
inline LineCount Buffer::line_count() const
|
||||
{
|
||||
return LineCount(m_lines.size());
|
||||
|
@ -148,6 +150,7 @@ inline bool BufferIterator::operator>=(const BufferIterator& iterator) const
|
|||
return (m_coord >= iterator.m_coord);
|
||||
}
|
||||
|
||||
[[gnu::always_inline]]
|
||||
inline char BufferIterator::operator*() const
|
||||
{
|
||||
return m_buffer->byte_at(m_coord);
|
||||
|
|
Loading…
Reference in New Issue
Block a user