Remove accidental SparsePage copies (#3583)

This commit is contained in:
Rory Mitchell
2018-08-13 12:49:38 +12:00
committed by Philip Hyunsu Cho
parent 0b607fb884
commit 645996b12f
16 changed files with 28 additions and 28 deletions

View File

@@ -36,7 +36,7 @@ void HistCutMatrix::Init(DMatrix* p_fmat, uint32_t max_num_bins) {
auto iter = p_fmat->RowIterator();
iter->BeforeFirst();
while (iter->Next()) {
auto batch = iter->Value();
auto &batch = iter->Value();
#pragma omp parallel num_threads(nthread)
{
CHECK_EQ(nthread, omp_get_num_threads());
@@ -137,7 +137,7 @@ void GHistIndexMatrix::Init(DMatrix* p_fmat, int max_num_bins) {
iter->BeforeFirst();
row_ptr.push_back(0);
while (iter->Next()) {
auto batch = iter->Value();
auto &batch = iter->Value();
const size_t rbegin = row_ptr.size() - 1;
for (size_t i = 0; i < batch.Size(); ++i) {
row_ptr.push_back(batch[i].length + row_ptr.back());