Commit ba2217ae authored by Guolin Ke's avatar Guolin Ke Committed by GitHub
Browse files

fix bug when splitting sparse bin with passed num_data=0 (#68)

parent ab5ab8a7
...@@ -59,6 +59,8 @@ public: ...@@ -59,6 +59,8 @@ public:
data_size_t Split(unsigned int threshold, data_size_t* data_indices, data_size_t num_data, data_size_t Split(unsigned int threshold, data_size_t* data_indices, data_size_t num_data,
data_size_t* lte_indices, data_size_t* gt_indices) const override { data_size_t* lte_indices, data_size_t* gt_indices) const override {
// not need to split
if (num_data <= 0) { return 0; }
const auto fast_pair = fast_index_[(data_indices[0]) >> fast_index_shift_]; const auto fast_pair = fast_index_[(data_indices[0]) >> fast_index_shift_];
data_size_t j = fast_pair.first; data_size_t j = fast_pair.first;
data_size_t cur_pos = fast_pair.second; data_size_t cur_pos = fast_pair.second;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment