Skip to content

Commit 2d1cff6

Browse files
authored
Let ROOT bind to the right type instead of casting to std::vector<int> (#993)
1 parent 5123e78 commit 2d1cff6

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/RNTupleWriter.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,9 @@ void RNTupleWriter::writeFrame(const podio::Frame& frame, std::string_view categ
135135

136136
if (const auto vmInfo = collBuffers.vectorMembers) {
137137
size_t i = 0;
138-
for (const auto& [type, vec] : *vmInfo) {
139-
const auto typeName = "vector<" + type + ">";
138+
for (const auto& vectorMember : *vmInfo) {
140139
const auto brName = root_utils::vecBranch(name, relVecNames.vectorMembers[i]);
141-
auto ptr = *static_cast<std::vector<int>**>(vec);
142-
entry->BindRawPtr(brName, ptr);
140+
entry->BindRawPtr(brName, *static_cast<void**>(vectorMember.second));
143141
++i;
144142
}
145143
}

0 commit comments

Comments
 (0)