Span: use size_t' for index_type, add front' and `back'. (#4935)

* Use `size_t' for index_type.  Add `front' and `back'.

* Remove a batch of `static_cast'.
This commit is contained in:
Jiaming Yuan
2019-10-14 09:13:33 -04:00
committed by GitHub
parent a9053aff83
commit b61d534472
9 changed files with 160 additions and 93 deletions

View File

@@ -343,7 +343,7 @@ struct GHistIndexBlock {
// get i-th row
inline GHistIndexRow operator[](size_t i) const {
return {&index[0] + row_ptr[i], detail::ptrdiff_t(row_ptr[i + 1] - row_ptr[i])};
return {&index[0] + row_ptr[i], row_ptr[i + 1] - row_ptr[i]};
}
};