Skip to content

Commit

Permalink
Favor constant references in return types in MemWatchTreeNode.
Browse files Browse the repository at this point in the history
A number of rich items were being passed by value unnecessarily.
  • Loading branch information
cristian64 committed May 29, 2024
1 parent 97eec51 commit eec4356
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Source/MemoryWatch/MemWatchTreeNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void MemWatchTreeNode::setValueEditing(const bool valueEditing)
m_isValueEditing = valueEditing;
}

QString MemWatchTreeNode::getGroupName() const
const QString& MemWatchTreeNode::getGroupName() const
{
return m_groupName;
}
Expand All @@ -67,7 +67,7 @@ void MemWatchTreeNode::setEntry(MemWatchEntry* entry)
m_entry = entry;
}

QVector<MemWatchTreeNode*> MemWatchTreeNode::getChildren() const
const QVector<MemWatchTreeNode*>& MemWatchTreeNode::getChildren() const
{
return m_children;
}
Expand Down
4 changes: 2 additions & 2 deletions Source/MemoryWatch/MemWatchTreeNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class MemWatchTreeNode
bool isGroup() const;
bool isExpanded() const { return m_expanded; }
void setExpanded(const bool expanded) { m_expanded = expanded; };
QString getGroupName() const;
const QString& getGroupName() const;
void setGroupName(const QString& groupName);
MemWatchEntry* getEntry() const;
void setEntry(MemWatchEntry* entry);
QVector<MemWatchTreeNode*> getChildren() const;
const QVector<MemWatchTreeNode*>& getChildren() const;
void setChildren(QVector<MemWatchTreeNode*> children);
MemWatchTreeNode* getParent() const;
void setParent(MemWatchTreeNode* parent);
Expand Down

0 comments on commit eec4356

Please sign in to comment.