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:
@@ -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()) {
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user