factory methods avoid creating unnecessary temporaries

Avoid some ref. counter activity (still have global mutex...)
This commit is contained in:
Michael Davidsaver
2017-09-30 11:09:52 -05:00
parent 6f2cae95e1
commit 406b163bcc
6 changed files with 15 additions and 23 deletions

View File

@@ -602,7 +602,7 @@ PVUnionPtr PVDataCreate::createPVUnion(PVUnionPtr const & unionToClone)
// TODO not thread-safe (local static initializers)
// TODO replace with non-locking singleton pattern
PVDataCreatePtr PVDataCreate::getPVDataCreate()
const PVDataCreatePtr& PVDataCreate::getPVDataCreate()
{
static PVDataCreatePtr pvDataCreate;
static Mutex mutex;
@@ -615,10 +615,6 @@ PVDataCreatePtr PVDataCreate::getPVDataCreate()
return pvDataCreate;
}
PVDataCreatePtr getPVDataCreate() {
return PVDataCreate::getPVDataCreate();
}
}}
namespace std{