Skip to content

Commit 004629f

Browse files
committed
DPL: TableBuilder::mFinaliser does not need to capture state
1 parent 2b57b59 commit 004629f

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Framework/Core/include/Framework/TableBuilder.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
// Apparently needs to be on top of the arrow includes.
2222
#include <sstream>
2323

24+
#include <arrow/chunked_array.h>
2425
#include <arrow/status.h>
2526
#include <arrow/memory_pool.h>
2627
#include <arrow/stl.h>
2728
#include <arrow/type_traits.h>
2829
#include <arrow/table.h>
2930
#include <arrow/builder.h>
3031

31-
#include <functional>
3232
#include <vector>
3333
#include <string>
3434
#include <memory>
@@ -587,7 +587,7 @@ class TableBuilder
587587
template <typename... ARGS>
588588
auto makeFinalizer()
589589
{
590-
mFinalizer = [schema = mSchema, &arrays = mArrays, holders = mHolders]() -> bool {
590+
mFinalizer = [](std::shared_ptr<arrow::Schema> schema, std::vector<std::shared_ptr<arrow::Array>>& arrays, void* holders) -> bool {
591591
return TableBuilderHelpers::finalize(arrays, *(HoldersTuple<ARGS...>*)holders, std::make_index_sequence<sizeof...(ARGS)>{});
592592
};
593593
}
@@ -753,7 +753,7 @@ class TableBuilder
753753
return this->template persist<E>(columnNames);
754754
}
755755

756-
std::function<bool(void)> mFinalizer;
756+
bool (*mFinalizer)(std::shared_ptr<arrow::Schema> schema, std::vector<std::shared_ptr<arrow::Array>>& arrays, void* holders);
757757
void* mHolders;
758758
arrow::MemoryPool* mMemoryPool;
759759
std::shared_ptr<arrow::Schema> mSchema;

Framework/Core/src/TableBuilder.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ namespace o2::framework
5050
std::shared_ptr<arrow::Table>
5151
TableBuilder::finalize()
5252
{
53-
bool status = mFinalizer();
53+
bool status = mFinalizer(mSchema, mArrays, mHolders);
5454
if (status == false) {
5555
throwError(runtime_error("Unable to finalize"));
5656
}

0 commit comments

Comments
 (0)