From afe2fbdc3fd908e8d673bdf2d44408744e61f723 Mon Sep 17 00:00:00 2001 From: Milo Yip Date: Tue, 14 Apr 2015 21:30:57 +0800 Subject: [PATCH] Fix the warnings again --- include/rapidjson/encodedstream.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/include/rapidjson/encodedstream.h b/include/rapidjson/encodedstream.h index f2cfd61..9a93b38 100644 --- a/include/rapidjson/encodedstream.h +++ b/include/rapidjson/encodedstream.h @@ -178,10 +178,8 @@ private: } // Runtime check whether the size of character type is sufficient. It only perform checks with assertion. - if (type_ == kUTF16LE || type_ == kUTF16BE) - RAPIDJSON_ASSERT(sizeof(Ch) >= 2); - else if (type_ == kUTF32LE || type_ == kUTF32BE) - RAPIDJSON_ASSERT(sizeof(Ch) >= 4); + if (type_ == kUTF16LE || type_ == kUTF16BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 2); + if (type_ == kUTF32LE || type_ == kUTF32BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 4); } typedef Ch (*TakeFunc)(InputByteStream& is); @@ -213,10 +211,8 @@ public: RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE); // Runtime check whether the size of character type is sufficient. It only perform checks with assertion. - if (type_ == kUTF16LE || type_ == kUTF16BE) - RAPIDJSON_ASSERT(sizeof(Ch) >= 2); - else if (type_ == kUTF32LE || type_ == kUTF32BE) - RAPIDJSON_ASSERT(sizeof(Ch) >= 4); + if (type_ == kUTF16LE || type_ == kUTF16BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 2); + if (type_ == kUTF32LE || type_ == kUTF32BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 4); static const PutFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Put) }; putFunc_ = f[type_];