From cc6a2f5ac3396ffdadba7d05a8d5957be4530ab8 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Fri, 3 Apr 2020 16:31:48 +0300 Subject: [PATCH] replace built-in assert with own CHECK macro (#2938) --- src/io/json11.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/io/json11.cpp b/src/io/json11.cpp index 9e1bb78c13c8..0be9bbdf3a6d 100644 --- a/src/io/json11.cpp +++ b/src/io/json11.cpp @@ -20,13 +20,12 @@ */ #include -#include -#ifndef LGB_R_BUILD - #include -#endif +#include + #include #include #include +#include namespace json11 { @@ -39,6 +38,8 @@ using std::make_shared; using std::initializer_list; using std::move; +using LightGBM::Log; + /* 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 * it may not be orderable. @@ -626,9 +627,7 @@ struct JsonParser final { * the input and return res. If not, flag an error. */ Json expect(const string &expected, Json res) { - #ifndef LGB_R_BUILD - assert(i != 0); - #endif + CHECK_NE(i, 0) i--; if (str.compare(i, expected.length(), expected) == 0) { i += expected.length();