Use const'ref in theses methods

Change-Id: Idfa5ffdcf23d1ef80442276690b8082b8279dbfa
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Montel Laurent
2017-04-14 10:12:30 +02:00
committed by Laurent Montel
parent c60103fc66
commit 86ea365a0b
27 changed files with 46 additions and 46 deletions

View File

@@ -58,7 +58,7 @@ ImportKind::Enum toImportKind(ImportType::Enum type)
return ImportKind::Invalid;
}
ImportMatchStrength::ImportMatchStrength(QList<int> match)
ImportMatchStrength::ImportMatchStrength(const QList<int> &match)
: m_match(match)
{ }
@@ -482,7 +482,7 @@ Export::Export()
: intrinsic(false)
{ }
Export::Export(ImportKey exportName, QString pathRequired, bool intrinsic, const QString &typeName)
Export::Export(ImportKey exportName, const QString &pathRequired, bool intrinsic, const QString &typeName)
: exportName(exportName), pathRequired(pathRequired), typeName(typeName), intrinsic(intrinsic)
{ }

View File

@@ -56,7 +56,7 @@ class QMLJS_EXPORT ImportMatchStrength
{
public:
explicit ImportMatchStrength() {}
ImportMatchStrength(QList<int> match);
ImportMatchStrength(const QList<int> &match);
int compareMatch(const ImportMatchStrength &o) const;
@@ -127,7 +127,7 @@ class QMLJS_EXPORT Export
public:
static QString libraryTypeName();
Export();
Export(ImportKey exportName, QString pathRequired, bool intrinsic = false,
Export(ImportKey exportName, const QString &pathRequired, bool intrinsic = false,
const QString &typeName = libraryTypeName());
ImportKey exportName;
QString pathRequired;

View File

@@ -94,7 +94,7 @@ protected:
{
public:
Program() {}
Program(QTextBlock begin, QTextBlock end)
Program(const QTextBlock &begin, const QTextBlock &end)
: begin(begin), end(end) {}
QTextBlock firstBlock() const { return begin; }

View File

@@ -39,7 +39,7 @@ ViewerContext::ViewerContext()
: language(Dialect::Qml), flags(AddAllPaths)
{ }
ViewerContext::ViewerContext(QStringList selectors, QStringList paths,
ViewerContext::ViewerContext(const QStringList &selectors, const QStringList &paths,
QmlJS::Dialect language,
QmlJS::ViewerContext::Flags flags)
: selectors(selectors), paths(paths), language(language),

View File

@@ -44,7 +44,7 @@ public:
};
ViewerContext();
ViewerContext(QStringList selectors, QStringList paths,
ViewerContext(const QStringList &selectors, const QStringList &paths,
Dialect language = Dialect::Qml,
Flags flags = AddAllPaths);