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

@@ -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{