Commit Graph
14 Commits
Author SHA1 Message Date
Jon Hanna 7e6194b61b Use GetValueOrDefault() over Value when Nullable<T> known non-null
GetValueOrDefault() is an easily-inlined access to a field as this
will hold the correct value for both HasValue and !HasValue cases.
The Value property in comparison contains a branch on a check that the
Nullable<T> has its internal hasValue flag to decide whether to throw
InvalidOperationException or not.

Hence when a nullable type is known to have a value (not be null) and
one wants the value, rather than to possibly trigger the exception-throw
GetValueOrDefault() has a slight performance benefit over Value.

Accordingly, replace calls to the Value property with calls to
GetValueOrDefault() when previous checks or assignments guarantee the
value is not null.
2015-12-15 19:15:58 +00:00
James Newton-King eb0cbd6a75 -Formatting
-Build
2015-12-04 23:54:38 +13:00
James Newton-King bcd6982419 -Code reformat 2013-10-20 15:08:39 +13:00
James Newton-King 405de98daf -Refactor 2013-04-25 04:12:26 +12:00
James Newton-King 03be3ed7a6 -Derp 2013-04-06 16:09:04 +13:00
James Newton-King 9d7046bca2 -Improve performance and memory usage when serializing Unicode characters 2012-07-09 18:35:41 +12:00
James Newton-King 1b972cd65f -Fixed DefaultValueHandling.Ignore with decimal properties
-Fixed approximate floating point comparisons
2012-06-09 13:54:30 +12:00
James Newton-King 83618b1ea0 -Line endings 2012-04-08 18:10:07 +12:00
JamesNK 61db48c01d -Removed unused utility methods
-Fixed various code warnings
2012-01-17 11:22:16 +00:00
JamesNK 868d6d3948 -Added Equals, NotEquals, GreaterThan, GreaterThanEquals, LesserThan, LesserThanEquals support to dynamic JValue
-Added IComparable to JValue
2011-01-17 07:19:20 +00:00
JamesNK 3ad33f7329 -Added ICloneable and DeepClone to JToken
-Changed DeepEquals to take into account possible floating point errors
2010-12-27 21:25:06 +00:00
JamesNK 6ce972156d -New improved BSON writer
-Performance improvement for reference loop checking
2010-03-24 10:43:41 +00:00
JamesNK 0319263756 -Added JSON Schema implementation
-Move test serialization objects to TestObjects namespace
-Fixed JsonConvert to always write a floating point number with a decimal place
-Changed Type values to serialize and deserialize to type name string
-Fixed JsonWriter to allow objects and arrays to be written in a constructor
-Added JsonContainerAttribute with Id, Title and Description members. JsonObject and JsonArray inherit from this attribute
-Added JsonArrayAttribute. Has flag to control whether array can contain null items.
-Added IsRequired to JsonProperty
-Replaced protected method GetSerializableMembers with GetMemberMappings on JsonSerializer
-Fixed QuoteChar not getting set when parsing property name
-Added Load(JsonReader) to JProperty, JConstructor
-Fixed error when populating JProperty with content from collection
-Added the ability for JsonTokenWriter to write individual values as well as arrays and objects
-Added CreateReader to JToken
-Added FromObject to JToken
-Added ReadFrom to JToken
2009-01-02 05:29:31 +00:00
JamesNK e65bc2becd 2007-09-08 08:59:38 +00:00