From 76d67b7eae55f48223d815184348bcdb0701f6ad Mon Sep 17 00:00:00 2001 From: miloyip Date: Wed, 15 Apr 2015 12:16:16 +0800 Subject: [PATCH] Improves coverage of Value::Accept() --- include/rapidjson/document.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index e436b8a..9ef0d91 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -1459,17 +1459,14 @@ public: case kStringType: return handler.String(GetString(), GetStringLength(), (flags_ & kCopyFlag) != 0); - case kNumberType: + default: + RAPIDJSON_ASSERT(GetType() == kNumberType); if (IsInt()) return handler.Int(data_.n.i.i); else if (IsUint()) return handler.Uint(data_.n.u.u); else if (IsInt64()) return handler.Int64(data_.n.i64); else if (IsUint64()) return handler.Uint64(data_.n.u64); else return handler.Double(data_.n.d); - - default: - RAPIDJSON_ASSERT(false); } - return false; } private: