C++: Pass some values by reference

Change-Id: If2829e9ec5f796714bf3906c17c4c654cdfc4dea
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Orgad Shaneh
2014-05-19 23:30:05 +03:00
committed by Orgad Shaneh
parent 589535c120
commit e23dbb4c65
2 changed files with 6 additions and 6 deletions

View File

@@ -82,7 +82,7 @@ QString CPlusPlus::toString(const Symbol *s, QString id)
indent(toString(s->type()))); indent(toString(s->type())));
} }
QString CPlusPlus::toString(LookupItem it, QString id) QString CPlusPlus::toString(const LookupItem &it, const QString &id)
{ {
QString result = QString::fromLatin1("%1:").arg(id); QString result = QString::fromLatin1("%1:").arg(id);
if (it.declaration()) if (it.declaration())
@@ -114,7 +114,7 @@ void CPlusPlus::dump(const Name *name)
qDebug() << qPrintable(toString(name)); qDebug() << qPrintable(toString(name));
} }
void CPlusPlus::dump(FullySpecifiedType ty) void CPlusPlus::dump(const FullySpecifiedType &ty)
{ {
qDebug() << qPrintable(toString(ty)); qDebug() << qPrintable(toString(ty));
} }
@@ -124,7 +124,7 @@ void CPlusPlus::dump(const Symbol *s)
qDebug() << qPrintable(toString(s)); qDebug() << qPrintable(toString(s));
} }
void CPlusPlus::dump(LookupItem it) void CPlusPlus::dump(const LookupItem &it)
{ {
qDebug() << qPrintable(toString(it)); qDebug() << qPrintable(toString(it));
} }

View File

@@ -43,13 +43,13 @@ namespace CPlusPlus {
QString CPLUSPLUS_EXPORT toString(const Name *name, QString id = QLatin1String("Name")); QString CPLUSPLUS_EXPORT toString(const Name *name, QString id = QLatin1String("Name"));
QString CPLUSPLUS_EXPORT toString(FullySpecifiedType ty, QString id = QLatin1String("Type")); QString CPLUSPLUS_EXPORT toString(FullySpecifiedType ty, QString id = QLatin1String("Type"));
QString CPLUSPLUS_EXPORT toString(const Symbol *s, QString id = QLatin1String("Symbol")); QString CPLUSPLUS_EXPORT toString(const Symbol *s, QString id = QLatin1String("Symbol"));
QString CPLUSPLUS_EXPORT toString(LookupItem it, QString id = QLatin1String("LookupItem")); QString CPLUSPLUS_EXPORT toString(const LookupItem &it, const QString &id = QLatin1String("LookupItem"));
QString CPLUSPLUS_EXPORT toString(const ClassOrNamespace *binding, QString id = QLatin1String("ClassOrNamespace")); QString CPLUSPLUS_EXPORT toString(const ClassOrNamespace *binding, QString id = QLatin1String("ClassOrNamespace"));
void CPLUSPLUS_EXPORT dump(const Name *name); void CPLUSPLUS_EXPORT dump(const Name *name);
void CPLUSPLUS_EXPORT dump(FullySpecifiedType ty); void CPLUSPLUS_EXPORT dump(const FullySpecifiedType &ty);
void CPLUSPLUS_EXPORT dump(const Symbol *s); void CPLUSPLUS_EXPORT dump(const Symbol *s);
void CPLUSPLUS_EXPORT dump(LookupItem it); void CPLUSPLUS_EXPORT dump(const LookupItem &it);
void CPLUSPLUS_EXPORT dump(const ClassOrNamespace *binding); void CPLUSPLUS_EXPORT dump(const ClassOrNamespace *binding);
} // namespace CPlusPlus } // namespace CPlusPlus