Switch OpaqueVal::SerializeType() to IntrusivePtr

This commit is contained in:
Jon Siwek 2020-05-18 16:10:10 -07:00
parent 377c8a4762
commit 5742810293
3 changed files with 5 additions and 5 deletions

View file

@ -96,7 +96,7 @@ IntrusivePtr<OpaqueVal> OpaqueVal::Unserialize(const broker::data& data)
return val; return val;
} }
broker::expected<broker::data> OpaqueVal::SerializeType(BroType* t) broker::expected<broker::data> OpaqueVal::SerializeType(const IntrusivePtr<BroType>& t)
{ {
if ( t->InternalType() == TYPE_INTERNAL_ERROR ) if ( t->InternalType() == TYPE_INTERNAL_ERROR )
return broker::ec::invalid_data; return broker::ec::invalid_data;
@ -818,7 +818,7 @@ broker::expected<broker::data> BloomFilterVal::DoSerialize() const
if ( type ) if ( type )
{ {
auto t = SerializeType(type.get()); auto t = SerializeType(type);
if ( ! t ) if ( ! t )
return broker::ec::invalid_data; return broker::ec::invalid_data;
@ -913,7 +913,7 @@ broker::expected<broker::data> CardinalityVal::DoSerialize() const
if ( type ) if ( type )
{ {
auto t = SerializeType(type.get()); auto t = SerializeType(type);
if ( ! t ) if ( ! t )
return broker::ec::invalid_data; return broker::ec::invalid_data;

View file

@ -148,7 +148,7 @@ protected:
* Helper function for derived class that need to record a type * Helper function for derived class that need to record a type
* during serialization. * during serialization.
*/ */
static broker::expected<broker::data> SerializeType(BroType* t); static broker::expected<broker::data> SerializeType(const IntrusivePtr<BroType>& t);
/** /**
* Helper function for derived class that need to restore a type * Helper function for derived class that need to restore a type

View file

@ -408,7 +408,7 @@ broker::expected<broker::data> TopkVal::DoSerialize() const
if ( type ) if ( type )
{ {
auto t = SerializeType(type.get()); auto t = SerializeType(type);
if ( ! t ) if ( ! t )
return broker::ec::invalid_data; return broker::ec::invalid_data;