зеркало из https://github.com/microsoft/LightGBM.git
use braced delete where appropriate (#4984)
This commit is contained in:
Родитель
c61f0d2eb3
Коммит
83a41dabec
|
@ -1966,17 +1966,17 @@ int LGBM_BoosterPredictSparseOutput(BoosterHandle handle,
|
|||
int LGBM_BoosterFreePredictSparse(void* indptr, int32_t* indices, void* data, int indptr_type, int data_type) {
|
||||
API_BEGIN();
|
||||
if (indptr_type == C_API_DTYPE_INT32) {
|
||||
delete reinterpret_cast<int32_t*>(indptr);
|
||||
delete[] reinterpret_cast<int32_t*>(indptr);
|
||||
} else if (indptr_type == C_API_DTYPE_INT64) {
|
||||
delete reinterpret_cast<int64_t*>(indptr);
|
||||
delete[] reinterpret_cast<int64_t*>(indptr);
|
||||
} else {
|
||||
Log::Fatal("Unknown indptr type in LGBM_BoosterFreePredictSparse");
|
||||
}
|
||||
delete indices;
|
||||
delete[] indices;
|
||||
if (data_type == C_API_DTYPE_FLOAT32) {
|
||||
delete reinterpret_cast<float*>(data);
|
||||
delete[] reinterpret_cast<float*>(data);
|
||||
} else if (data_type == C_API_DTYPE_FLOAT64) {
|
||||
delete reinterpret_cast<double*>(data);
|
||||
delete[] reinterpret_cast<double*>(data);
|
||||
} else {
|
||||
Log::Fatal("Unknown data type in LGBM_BoosterFreePredictSparse");
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче