factory methods avoid creating unnecessary temporaries

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

No files matched your search

+1 -5
View File
@@ -1418,7 +1418,7 @@ FieldConstPtr FieldCreate::deserialize(ByteBuffer* buffer, DeserializableControl
}
// TODO replace with non-locking singleton pattern
FieldCreatePtr FieldCreate::getFieldCreate()
const FieldCreatePtr& FieldCreate::getFieldCreate()
{
LOCAL_STATIC_LOCK;
static FieldCreatePtr fieldCreate;
@@ -1456,10 +1456,6 @@ FieldCreate::FieldCreate()
variantUnionArray = sua;
}
FieldCreatePtr getFieldCreate() {
return FieldCreate::getFieldCreate();
}
}}
namespace std{