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_];