Skip to content

Commit

Permalink
don't compare std::function to nullptr ref microsoft#4633
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cortes committed Oct 12, 2021
1 parent 5c8a331 commit f0ebbf7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/io/dataset_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ void DatasetLoader::ExtractFeaturesFromMemory(std::vector<std::string>* text_dat
double tmp_label = 0.0f;
auto& ref_text_data = *text_data;
std::vector<float> feature_row(dataset->num_features_);
if (predict_fun_ == nullptr) {
if (!predict_fun_) {
OMP_INIT_EX();
// if doesn't need to prediction with initial model
#pragma omp parallel for schedule(static) private(oneline_features) firstprivate(tmp_label, feature_row)
Expand Down Expand Up @@ -1262,7 +1262,7 @@ void DatasetLoader::ExtractFeaturesFromMemory(std::vector<std::string>* text_dat
void DatasetLoader::ExtractFeaturesFromFile(const char* filename, const Parser* parser,
const std::vector<data_size_t>& used_data_indices, Dataset* dataset) {
std::vector<double> init_score;
if (predict_fun_ != nullptr) {
if (predict_fun_) {
init_score = std::vector<double>(dataset->num_data_ * num_class_);
}
std::function<void(data_size_t, const std::vector<std::string>&)> process_fun =
Expand Down

0 comments on commit f0ebbf7

Please sign in to comment.