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
cc6a2f5a
Unverified
Commit
cc6a2f5a
authored
Apr 03, 2020
by
Nikita Titov
Committed by
GitHub
Apr 03, 2020
Browse files
replace built-in assert with own CHECK macro (#2938)
parent
51f37e9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
src/io/json11.cpp
src/io/json11.cpp
+6
-7
No files found.
src/io/json11.cpp
View file @
cc6a2f5a
...
@@ -20,13 +20,12 @@
...
@@ -20,13 +20,12 @@
*/
*/
#include <LightGBM/utils/json11.h>
#include <LightGBM/utils/json11.h>
#include <limits>
#include <LightGBM/utils/log.h>
#ifndef LGB_R_BUILD
#include <cassert>
#endif
#include <cmath>
#include <cmath>
#include <cstdio>
#include <cstdio>
#include <cstdlib>
#include <cstdlib>
#include <limits>
namespace
json11
{
namespace
json11
{
...
@@ -39,6 +38,8 @@ using std::make_shared;
...
@@ -39,6 +38,8 @@ using std::make_shared;
using
std
::
initializer_list
;
using
std
::
initializer_list
;
using
std
::
move
;
using
std
::
move
;
using
LightGBM
::
Log
;
/* Helper for representing null - just a do-nothing struct, plus comparison
/* Helper for representing null - just a do-nothing struct, plus comparison
* operators so the helpers in JsonValue work. We can't use nullptr_t because
* operators so the helpers in JsonValue work. We can't use nullptr_t because
* it may not be orderable.
* it may not be orderable.
...
@@ -626,9 +627,7 @@ struct JsonParser final {
...
@@ -626,9 +627,7 @@ struct JsonParser final {
* the input and return res. If not, flag an error.
* the input and return res. If not, flag an error.
*/
*/
Json
expect
(
const
string
&
expected
,
Json
res
)
{
Json
expect
(
const
string
&
expected
,
Json
res
)
{
#ifndef LGB_R_BUILD
CHECK_NE
(
i
,
0
)
assert
(
i
!=
0
);
#endif
i
--
;
i
--
;
if
(
str
.
compare
(
i
,
expected
.
length
(),
expected
)
==
0
)
{
if
(
str
.
compare
(
i
,
expected
.
length
(),
expected
)
==
0
)
{
i
+=
expected
.
length
();
i
+=
expected
.
length
();
...
...
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