-Performance

This commit is contained in:
James Newton-King
2013-04-01 23:51:40 +13:00
parent 33a5604707
commit cb7ac1dfb4
7 changed files with 22 additions and 24 deletions
@@ -85,8 +85,9 @@ namespace Newtonsoft.Json.Serialization
private void SerializePrimitive(JsonWriter writer, object value, JsonPrimitiveContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)
{
if (contract.UnderlyingType == typeof (byte[]))
if (contract.TypeCode == PrimitiveTypeCode.Bytes)
{
// if type name handling is enabled then wrap the base64 byte string in an object with the type name
bool includeTypeDetails = ShouldWriteType(TypeNameHandling.Objects, contract, member, containerContract, containerProperty);
if (includeTypeDetails)
{