Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed May 17, 2020
1 parent fcd14c4 commit 0da6025
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/boosting/prediction_early_stop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,18 @@ PredictionEarlyStopInstance CreateBinary(const PredictionEarlyStopConfig& config

PredictionEarlyStopInstance CreatePredictionEarlyStopInstance(const std::string& type,
const PredictionEarlyStopConfig& config) {
if (type != "none" && type != "multiclass" && type != "binary") {
Log::Fatal("Unknown early stopping type: %s", type.c_str());
}

if (type == "none") {
return CreateNone(config);
} else if (type == "multiclass") {
return CreateMulticlass(config);
} else if (type == "binary") {
return CreateBinary(config);
} else {
Log::Fatal("Unknown early stopping type: %s", type.c_str());
}

// "binary"
return CreateBinary(config);
// Fix for compiler warnings about reaching end of control
return CreateNone(config);
}

} // namespace LightGBM

0 comments on commit 0da6025

Please sign in to comment.