Skip to content

Commit

Permalink
[ntuple] set id for unsplit field in RFieldDescriptor::CreateField()
Browse files Browse the repository at this point in the history
This is a minor fix/improvement. The RNTupleReader will figure out the
field ID if not set by RFieldDescriptor::CreateField() but this requires
another descriptor lookup.
  • Loading branch information
jblomer committed Jul 8, 2024
1 parent 791b4a3 commit c5bf636
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tree/ntuple/v7/src/RNTupleDescriptor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ std::unique_ptr<ROOT::Experimental::RFieldBase>
ROOT::Experimental::RFieldDescriptor::CreateField(const RNTupleDescriptor &ntplDesc) const
{
if (GetStructure() == ENTupleStructure::kUnsplit) {
return std::make_unique<RUnsplitField>(GetFieldName(), GetTypeName());
auto unsplitField = std::make_unique<RUnsplitField>(GetFieldName(), GetTypeName());
unsplitField->SetOnDiskId(fFieldId);
return unsplitField;
}

if (GetTypeName().empty()) {
Expand Down

0 comments on commit c5bf636

Please sign in to comment.