summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2021-03-29 18:15:55 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2021-03-29 18:15:55 (GMT)
commit265b08e206c52b81efc102a563b31fbc4109244c (patch)
treedb0dc9d34c7351a495ff5fed4d622d35fb21c36c /src
parent42bac34be2b7b4beb5ee468926ed0bf0e7528fd2 (diff)
downloadDoxygen-265b08e206c52b81efc102a563b31fbc4109244c.zip
Doxygen-265b08e206c52b81efc102a563b31fbc4109244c.tar.gz
Doxygen-265b08e206c52b81efc102a563b31fbc4109244c.tar.bz2
Performance improvement by returning BaseClassList by reference
Diffstat (limited to 'src')
-rw-r--r--src/classdef.cpp12
-rw-r--r--src/classdef.h4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp
index 4d4b2ae..542147a 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -177,9 +177,9 @@ class ClassDefImpl : public DefinitionMixin<ClassDefMutable>
virtual QCString displayName(bool includeScope=TRUE) const;
virtual CompoundType compoundType() const;
virtual QCString compoundTypeString() const;
- virtual BaseClassList baseClasses() const;
+ virtual const BaseClassList &baseClasses() const;
virtual void updateBaseClasses(const BaseClassList &bcd);
- virtual BaseClassList subClasses() const;
+ virtual const BaseClassList &subClasses() const;
virtual void updateSubClasses(const BaseClassList &bcd);
virtual const MemberNameInfoLinkedMap &memberNameInfoLinkedMap() const;
virtual Protection protection() const;
@@ -408,9 +408,9 @@ class ClassDefAliasImpl : public DefinitionAliasMixin<ClassDef>
{ return getCdAlias()->compoundType(); }
virtual QCString compoundTypeString() const
{ return getCdAlias()->compoundTypeString(); }
- virtual BaseClassList baseClasses() const
+ virtual const BaseClassList &baseClasses() const
{ return getCdAlias()->baseClasses(); }
- virtual BaseClassList subClasses() const
+ virtual const BaseClassList &subClasses() const
{ return getCdAlias()->subClasses(); }
virtual const MemberNameInfoLinkedMap &memberNameInfoLinkedMap() const
{ return getCdAlias()->memberNameInfoLinkedMap(); }
@@ -4495,7 +4495,7 @@ ClassDefImpl::CompoundType ClassDefImpl::compoundType() const
return m_impl->compType;
}
-BaseClassList ClassDefImpl::baseClasses() const
+const BaseClassList &ClassDefImpl::baseClasses() const
{
return m_impl->inherits;
}
@@ -4505,7 +4505,7 @@ void ClassDefImpl::updateBaseClasses(const BaseClassList &bcd)
m_impl->inherits = bcd;
}
-BaseClassList ClassDefImpl::subClasses() const
+const BaseClassList &ClassDefImpl::subClasses() const
{
return m_impl->inheritedBy;
}
diff --git a/src/classdef.h b/src/classdef.h
index 4e29a2e..d6c515d 100644
--- a/src/classdef.h
+++ b/src/classdef.h
@@ -167,14 +167,14 @@ class ClassDef : public Definition
/** Returns the list of base classes from which this class directly
* inherits.
*/
- virtual BaseClassList baseClasses() const = 0;
+ virtual const BaseClassList &baseClasses() const = 0;
/** Update the list of base classes to the one passed */
virtual void updateBaseClasses(const BaseClassList &bcd) = 0;
/** Returns the list of sub classes that directly derive from this class
*/
- virtual BaseClassList subClasses() const = 0;
+ virtual const BaseClassList &subClasses() const = 0;
/** Update the list of sub classes to the one passed */
virtual void updateSubClasses(const BaseClassList &bcd) = 0;