Skip to content

Commit

Permalink
DPL Analysis: avoid extra cursorHelper methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ktf committed Feb 7, 2024
1 parent 8482d12 commit a919d1f
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions Framework/Core/include/Framework/TableBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -795,13 +795,17 @@ class TableBuilder
template <typename T>
auto cursor()
{
return cursorHelper(typename T::table_t::persistent_columns_t{});
return [this]<typename... Cs>(pack<Cs...>) {
return this->template persist<typename Cs::type...>({Cs::columnLabel()...});
}(typename T::table_t::persistent_columns_t{});
}

template <typename T, typename E>
auto cursor()
{
return cursorHelper2<E>(typename T::table_t::persistent_columns_t{});
return [this]<typename... Cs>(pack<Cs...>) {
return this->template persist<E>({Cs::columnLabel()...});
}(typename T::table_t::persistent_columns_t{});
}

template <typename... ARGS, size_t NCOLUMNS = sizeof...(ARGS)>
Expand Down Expand Up @@ -861,21 +865,6 @@ class TableBuilder
std::shared_ptr<arrow::Table> finalize();

private:
/// Helper which actually creates the insertion cursor. Notice that the
/// template argument T is a o2::soa::Table which contains only the
/// persistent columns.
template <typename... Cs>
auto cursorHelper(framework::pack<Cs...>)
{
return this->template persist<typename Cs::type...>({Cs::columnLabel()...});
}

template <typename E, typename... Cs>
auto cursorHelper2(framework::pack<Cs...>)
{
return this->template persist<E>({Cs::columnLabel()...});
}

bool (*mFinalizer)(std::vector<std::shared_ptr<arrow::Array>>& arrays, void* holders);
void (*mDestructor)(void* holders);
void* mHolders;
Expand Down

0 comments on commit a919d1f

Please sign in to comment.