forked from qt-creator/qt-creator
C++: Inline often used member functions of TranslationUnit
As indicated by profiling. Change-Id: I92d79b52d2d56540da39559fe4db3c22ab53a73a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user