@@ -738,7 +738,7 @@ TreeToTable::~TreeToTable()
738738
739739bool TreeToTable::addColumn (const char * colname)
740740{
741- auto colit = std::make_shared <ColumnIterator>(mTreeReader , colname);
741+ auto colit = std::make_unique <ColumnIterator>(mTreeReader , colname);
742742 auto stat = colit->getStatus ();
743743 if (stat) {
744744 mColumnIterators .push_back (std::move (colit));
@@ -763,7 +763,7 @@ bool TreeToTable::addAllColumns()
763763 auto br = (TBranch*)branchList->At (ii);
764764
765765 // IMPROVE: make sure that a column is not added more than one time
766- auto colit = std::make_shared <ColumnIterator>(mTreeReader , br->GetName ());
766+ auto colit = std::make_unique <ColumnIterator>(mTreeReader , br->GetName ());
767767 if (colit->getStatus ()) {
768768 mColumnIterators .push_back (std::move (colit));
769769 } else {
@@ -776,14 +776,14 @@ bool TreeToTable::addAllColumns()
776776
777777void TreeToTable::push ()
778778{
779- for (auto colit : mColumnIterators ) {
779+ for (auto && colit : mColumnIterators ) {
780780 colit->push ();
781781 }
782782}
783783
784784void TreeToTable::reserve (size_t s)
785785{
786- for (auto column : mColumnIterators ) {
786+ for (auto && column : mColumnIterators ) {
787787 column->reserve (s);
788788 }
789789}
@@ -805,7 +805,7 @@ std::shared_ptr<arrow::Table> TreeToTable::finalize()
805805 // prepare the elements needed to create the final table
806806 std::vector<std::shared_ptr<arrow::Array>> array_vector;
807807 std::vector<std::shared_ptr<arrow::Field>> schema_vector;
808- for (auto colit : mColumnIterators ) {
808+ for (auto && colit : mColumnIterators ) {
809809 colit->finish ();
810810 array_vector.push_back (colit->getArray ());
811811 schema_vector.push_back (colit->getSchema ());
0 commit comments