don't use shared_ptr::get() for null test

unnecesarily verbose
This commit is contained in:
Michael Davidsaver
2018-02-12 14:25:43 -08:00
parent f2ad6292f5
commit 7e8c49f0a0
5 changed files with 14 additions and 14 deletions

View File

@@ -30,14 +30,14 @@ bool PVTimeStamp::attach(PVFieldPtr const & pvField)
PVStructure* pvStructure = xxx.get();
while(true) {
PVLongPtr pvLong = pvStructure->getSubField<PVLong>("secondsPastEpoch");
if(pvLong.get()!=NULL) {
if(pvLong) {
pvSecs = pvLong;
pvNano = pvStructure->getSubField<PVInt>("nanoseconds");
pvUserTag = pvStructure->getSubField<PVInt>("userTag");
}
if(pvSecs.get()!=NULL
&& pvNano.get()!=NULL
&& pvUserTag.get()!=NULL) return true;
if(pvSecs
&& pvNano
&& pvUserTag) return true;
detach();
// look up the tree for a timeSyamp
pvStructure = pvStructure->getParent();