From 3597fbe382411a5343281031d6c36c83c8a8c9e3 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Wed, 16 Aug 2017 17:49:17 +0200 Subject: [PATCH] avoid unnecessary temp shared_ptr avoid some extra ref. counter operations. --- src/factory/PVStructure.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/factory/PVStructure.cpp b/src/factory/PVStructure.cpp index be65a9e..166440e 100644 --- a/src/factory/PVStructure.cpp +++ b/src/factory/PVStructure.cpp @@ -259,7 +259,7 @@ void PVStructure::serialize(ByteBuffer *pbuffer, size_t fieldsSize = pvFields.size(); for(size_t i = 0; igetFieldOffset(); int32 inumberFields = static_cast(pvField->getNumberFields()); next = pbitSet->nextSetBit(static_cast(offset)); @@ -273,8 +273,7 @@ void PVStructure::serialize(ByteBuffer *pbuffer, if(inumberFields==1) { pvField->serialize(pbuffer, pflusher); } else { - PVStructurePtr pvStructure = std::tr1::static_pointer_cast(pvField); - pvStructure->serialize(pbuffer, pflusher, pbitSet); + static_cast(pvField)->serialize(pbuffer, pflusher, pbitSet); } } }