Commit 51ca982a authored by Jean-Claude Monnin's avatar Jean-Claude Monnin

Fix warning when NDEBUG is defined [-Wunused-variable]

Because `isPeek()` is side effect free this should not change anything.

The reason this warning is not shown in the unit tests is because the asserts
are always evaluated in the unit test:

#define RAPIDJSON_ASSERT(x) (!(x) ? throw AssertException(RAPIDJSON_STRINGIFY(x)) : (void)0u)
parent 67fac85e
...@@ -460,8 +460,7 @@ protected: ...@@ -460,8 +460,7 @@ protected:
PutReserve(*os_, length); PutReserve(*os_, length);
GenericStringStream<SourceEncoding> is(json); GenericStringStream<SourceEncoding> is(json);
while (RAPIDJSON_LIKELY(is.Tell() < length)) { while (RAPIDJSON_LIKELY(is.Tell() < length)) {
const Ch c = is.Peek(); RAPIDJSON_ASSERT(is.Peek() != '\0');
RAPIDJSON_ASSERT(c != '\0');
if (RAPIDJSON_UNLIKELY(!(writeFlags & kWriteValidateEncodingFlag ? if (RAPIDJSON_UNLIKELY(!(writeFlags & kWriteValidateEncodingFlag ?
Transcoder<SourceEncoding, TargetEncoding>::Validate(is, *os_) : Transcoder<SourceEncoding, TargetEncoding>::Validate(is, *os_) :
Transcoder<SourceEncoding, TargetEncoding>::TranscodeUnsafe(is, *os_)))) Transcoder<SourceEncoding, TargetEncoding>::TranscodeUnsafe(is, *os_))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment