Add explicit cast to pass 32-bit CRAN check (#5777)

This commit is contained in:
Philip Hyunsu Cho 2020-06-14 09:36:13 +00:00 committed by GitHub
parent 34408a7fdc
commit d6d8be6519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,7 +181,7 @@ XGB_DLL int XGDMatrixSliceDMatrixEx(DMatrixHandle handle,
<< "slice does not support group structure";
}
DMatrix* dmat = static_cast<std::shared_ptr<DMatrix>*>(handle)->get();
*out = new std::shared_ptr<DMatrix>(dmat->Slice({idxset, len}));
*out = new std::shared_ptr<DMatrix>(dmat->Slice({idxset, static_cast<std::size_t>(len)}));
API_END();
}