Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
83a41dab
Unverified
Commit
83a41dab
authored
Feb 17, 2022
by
david-cortes
Committed by
GitHub
Feb 18, 2022
Browse files
use braced delete where appropriate (#4984)
parent
c61f0d2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/c_api.cpp
src/c_api.cpp
+5
-5
No files found.
src/c_api.cpp
View file @
83a41dab
...
...
@@ -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"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment