зеркало из https://github.com/microsoft/LightGBM.git
consolidate duplicate conditions in TextReader (#4530)
This commit is contained in:
Родитель
981853b108
Коммит
a926d4fe93
|
@ -198,8 +198,10 @@ class TextReader {
|
|||
[&filter_fun, &out_used_data_indices, this]
|
||||
(INDEX_T line_idx , const char* buffer, size_t size) {
|
||||
bool is_used = filter_fun(line_idx);
|
||||
if (is_used) { out_used_data_indices->push_back(line_idx); }
|
||||
if (is_used) { lines_.emplace_back(buffer, size); }
|
||||
if (is_used) {
|
||||
out_used_data_indices->push_back(line_idx);
|
||||
lines_.emplace_back(buffer, size);
|
||||
}
|
||||
});
|
||||
return total_cnt;
|
||||
}
|
||||
|
@ -213,8 +215,8 @@ class TextReader {
|
|||
&out_sampled_data]
|
||||
(INDEX_T line_idx, const char* buffer, size_t size) {
|
||||
bool is_used = filter_fun(line_idx);
|
||||
if (is_used) { out_used_data_indices->push_back(line_idx); }
|
||||
if (is_used) {
|
||||
out_used_data_indices->push_back(line_idx);
|
||||
if (cur_sample_cnt < sample_cnt) {
|
||||
out_sampled_data->emplace_back(buffer, size);
|
||||
++cur_sample_cnt;
|
||||
|
|
Загрузка…
Ссылка в новой задаче