From 9fa5028f6c511b0a971b92ea9628fb378e88ca01 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Fri, 7 Jul 2017 14:39:25 +0200 Subject: [PATCH] PVStructure::getStructure() avoid creation of temporary avoid some ref-counter activity --- src/factory/PVStructure.cpp | 2 +- src/pv/pvData.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/factory/PVStructure.cpp b/src/factory/PVStructure.cpp index b24c553..861f5ac 100644 --- a/src/factory/PVStructure.cpp +++ b/src/factory/PVStructure.cpp @@ -74,7 +74,7 @@ void PVStructure::setImmutable() PVField::setImmutable(); } -StructureConstPtr PVStructure::getStructure() const +const StructureConstPtr& PVStructure::getStructure() const { return structurePtr; } diff --git a/src/pv/pvData.h b/src/pv/pvData.h index cf34b29..05df98b 100644 --- a/src/pv/pvData.h +++ b/src/pv/pvData.h @@ -756,7 +756,7 @@ public: * Get the introspection interface * @return The interface. */ - StructureConstPtr getStructure() const; + const StructureConstPtr &getStructure() const; /** * Get the array of pointers to the subfields in the structure. * @return The array.