Switch RecordVal::CoerceTo() to use IntrusivePtr

This commit is contained in:
Jon Siwek 2020-05-18 17:52:54 -07:00
parent fcaade6e31
commit cda4738407
6 changed files with 39 additions and 28 deletions

View file

@ -701,7 +701,7 @@ bool Manager::Write(EnumVal* id, RecordVal* columns_arg)
if ( ! stream->enabled )
return true;
auto columns = columns_arg->CoerceTo(stream->columns);
auto columns = columns_arg->CoerceTo({NewRef{}, stream->columns});
if ( ! columns )
{
@ -747,7 +747,7 @@ bool Manager::Write(EnumVal* id, RecordVal* columns_arg)
const auto& rt = filter->path_func->GetType()->Params()->GetFieldType("rec");
if ( rt->Tag() == TYPE_RECORD )
rec_arg = columns->CoerceTo(rt->AsRecordType(), true);
rec_arg = columns->CoerceTo(cast_intrusive<RecordType>(rt), true);
else
// Can be TYPE_ANY here.
rec_arg = columns;