forked from qt-creator/qt-creator
CPlusPlus: Microoptimizations
Inline some simple accessors, return references instead of copies in some getters, Change-Id: I136574823c79ad0c63ed354b78e1ad83908e7ae5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -294,11 +294,6 @@ Document::~Document()
|
||||
_control = nullptr;
|
||||
}
|
||||
|
||||
Control *Document::control() const
|
||||
{
|
||||
return _control;
|
||||
}
|
||||
|
||||
Control *Document::swapControl(Control *newControl)
|
||||
{
|
||||
if (newControl) {
|
||||
@@ -318,41 +313,11 @@ Control *Document::swapControl(Control *newControl)
|
||||
return oldControl;
|
||||
}
|
||||
|
||||
unsigned Document::revision() const
|
||||
{
|
||||
return _revision;
|
||||
}
|
||||
|
||||
void Document::setRevision(unsigned revision)
|
||||
{
|
||||
_revision = revision;
|
||||
}
|
||||
|
||||
unsigned Document::editorRevision() const
|
||||
{
|
||||
return _editorRevision;
|
||||
}
|
||||
|
||||
void Document::setEditorRevision(unsigned editorRevision)
|
||||
{
|
||||
_editorRevision = editorRevision;
|
||||
}
|
||||
|
||||
QDateTime Document::lastModified() const
|
||||
{
|
||||
return _lastModified;
|
||||
}
|
||||
|
||||
void Document::setLastModified(const QDateTime &lastModified)
|
||||
{
|
||||
_lastModified = lastModified;
|
||||
}
|
||||
|
||||
QString Document::fileName() const
|
||||
{
|
||||
return _fileName;
|
||||
}
|
||||
|
||||
QStringList Document::includedFiles() const
|
||||
{
|
||||
QStringList files;
|
||||
@@ -455,11 +420,6 @@ void Document::addUndefinedMacroUse(const QByteArray &name,
|
||||
\sa Document::macroUses(), Document::undefinedMacroUses()
|
||||
*/
|
||||
|
||||
TranslationUnit *Document::translationUnit() const
|
||||
{
|
||||
return _translationUnit;
|
||||
}
|
||||
|
||||
bool Document::skipFunctionBody() const
|
||||
{
|
||||
return _translationUnit->skipFunctionBody();
|
||||
@@ -483,11 +443,6 @@ Symbol *Document::globalSymbolAt(int index) const
|
||||
return _globalNamespace->memberAt(index);
|
||||
}
|
||||
|
||||
Namespace *Document::globalNamespace() const
|
||||
{
|
||||
return _globalNamespace;
|
||||
}
|
||||
|
||||
void Document::setGlobalNamespace(Namespace *globalNamespace)
|
||||
{
|
||||
_globalNamespace = globalNamespace;
|
||||
@@ -590,9 +545,6 @@ Document::Ptr Document::create(const QString &fileName)
|
||||
return doc;
|
||||
}
|
||||
|
||||
QByteArray Document::utf8Source() const
|
||||
{ return _source; }
|
||||
|
||||
void Document::setUtf8Source(const QByteArray &source)
|
||||
{
|
||||
_source = source;
|
||||
|
||||
Reference in New Issue
Block a user