From eec4356dc7812b3de6f71c356fa4dcb4afb06823 Mon Sep 17 00:00:00 2001 From: cristian64 Date: Mon, 27 May 2024 22:14:23 +0100 Subject: [PATCH] Favor constant references in return types in `MemWatchTreeNode`. A number of rich items were being passed by value unnecessarily. --- Source/MemoryWatch/MemWatchTreeNode.cpp | 4 ++-- Source/MemoryWatch/MemWatchTreeNode.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/MemoryWatch/MemWatchTreeNode.cpp b/Source/MemoryWatch/MemWatchTreeNode.cpp index 8b3e9b0..0f6623b 100644 --- a/Source/MemoryWatch/MemWatchTreeNode.cpp +++ b/Source/MemoryWatch/MemWatchTreeNode.cpp @@ -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; } @@ -67,7 +67,7 @@ void MemWatchTreeNode::setEntry(MemWatchEntry* entry) m_entry = entry; } -QVector MemWatchTreeNode::getChildren() const +const QVector& MemWatchTreeNode::getChildren() const { return m_children; } diff --git a/Source/MemoryWatch/MemWatchTreeNode.h b/Source/MemoryWatch/MemWatchTreeNode.h index fd3aaa4..47173c9 100644 --- a/Source/MemoryWatch/MemWatchTreeNode.h +++ b/Source/MemoryWatch/MemWatchTreeNode.h @@ -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 getChildren() const; + const QVector& getChildren() const; void setChildren(QVector children); MemWatchTreeNode* getParent() const; void setParent(MemWatchTreeNode* parent);