Reduce number of unneeded copies

This patch aims at reducing the number of copies for obejcts that could
be referenced rather than copied, because they're not modified during
the computation.
This commit is contained in:
Gianluca Recchia
2018-10-28 12:49:32 +01:00
parent a67a574b89
commit da9afd3f6f
40 changed files with 90 additions and 90 deletions

View File

@@ -315,7 +315,7 @@ void CsvImportWidget::setRootGroup()
m_db->rootGroup()->setName("Root");
}
Group* CsvImportWidget::splitGroups(QString label)
Group* CsvImportWidget::splitGroups(const QString& label)
{
// extract group names from nested path provided in "label"
Group* current = m_db->rootGroup();
@@ -345,7 +345,7 @@ Group* CsvImportWidget::splitGroups(QString label)
return current;
}
Group* CsvImportWidget::hasChildren(Group* current, QString groupName)
Group* CsvImportWidget::hasChildren(Group* current, const QString& groupName)
{
// returns the group whose name is "groupName" and is child of "current" group
for (Group* group : current->children()) {

View File

@@ -68,8 +68,8 @@ private:
QStringList m_fieldSeparatorList;
void configParser();
void updateTableview();
Group* splitGroups(QString label);
Group* hasChildren(Group* current, QString groupName);
Group* splitGroups(const QString& label);
Group* hasChildren(Group* current, const QString& groupName);
QString formatStatusText() const;
};