Commit 61059f84 authored by hjk's avatar hjk
Browse files

C++: Inline often used member functions of TranslationUnit



As indicated by profiling.

Change-Id: I92d79b52d2d56540da39559fe4db3c22ab53a73a
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
parent 90b4f5c9
......@@ -108,15 +108,6 @@ void TranslationUnit::setSource(const char *source, unsigned size)
_lastSourceChar = source + size;
}
unsigned TranslationUnit::tokenCount() const
{ return _tokens->size(); }
const Token &TranslationUnit::tokenAt(unsigned index) const
{ return _tokens->at(index); }
int TranslationUnit::tokenKind(unsigned index) const
{ return _tokens->at(index).f.kind; }
const char *TranslationUnit::spell(unsigned index) const
{
if (! index)
......
......@@ -52,9 +52,12 @@ public:
void setSource(const char *source, unsigned size);
unsigned tokenCount() const;
const Token &tokenAt(unsigned index) const;
int tokenKind(unsigned index) const;
unsigned tokenCount() const
{ return _tokens->size(); }
const Token &tokenAt(unsigned index) const
{ return _tokens->at(index); }
int tokenKind(unsigned index) const
{ return _tokens->at(index).f.kind; }
const char *spell(unsigned index) const;
unsigned commentCount() const;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment