Commit Graph
1341 Commits
Author SHA1 Message Date
James Newton-King 5bd69fe8be Merge pull request #1131 from JonHanna/opt_extensions_values
Optimise Extensions.Values
2017-01-05 16:58:12 +13:00
Jon Hanna 4db6579593 Optimise Extensions.Values
Branch on key being null or not once, rather than once per loop.

Remove up-cast of token to JToken to allow jitter to either elide
JValue path if impossible or turn into null-test when inevitable.

Replace is-and-cast with as-and-null-test for quicker cast in cases
where cast is still done.
2017-01-05 00:49:54 +00:00
James Newton-King 008a3c7655 Merge pull request #1126 from JonHanna/remove_list_array
Remove some unnecessary list and array allocations.
2017-01-05 11:32:37 +13:00
Jon Hanna d408066f64 Remove some unnecessary list and array allocations. 2017-01-04 22:22:26 +00:00
James Newton-King 306c3a812b Merge pull request #1125 from JonHanna/null_propogate
Use null-propogation where applicable and useful.
2017-01-05 11:15:49 +13:00
James Newton-King 60651dbd59 Merge pull request #1127 from stakx/issue-typos
Fix typos
2017-01-05 11:06:24 +13:00
James Newton-King 1a70298696 Merge pull request #1130 from JonHanna/linq_bridge_optimise
Linq bridge optimise
2017-01-05 11:01:06 +13:00
Jon Hanna f5c64fdd09 Optimise linqbridge Select 2017-01-04 16:20:58 +00:00
Jon Hanna 896448860a Optimise LinqBridge.Enumerable.Where 2017-01-04 15:48:12 +00:00
Jon Hanna c003ad0d98 Optimise decimal predicate sum 2017-01-04 15:45:48 +00:00
Jon Hanna 32d8b4a68a Optimise LinqBridge Any 2017-01-04 15:45:06 +00:00
Jon Hanna dbc7374995 Optimise LinqBridge Count 2017-01-04 15:17:22 +00:00
Jon Hanna e08d1f7524 Optimise ToArray for list source 2017-01-04 15:01:48 +00:00
Jon Hanna 5bd4521b53 Load stack for Reverse using enumerable-taking ctor 2017-01-04 14:53:16 +00:00
Jon Hanna 1829b71255 Optimise LinqBridge.Enumerable.Cast for direct cast available.
(This changes the behaviour to return same type, but framework Linq has
the same optimisation).
2017-01-04 14:52:30 +00:00
stakx 8639ac94ae Typos
Running a spell checker on the whole solution revealed a couple more
typos. This fixes all of those (although internal // line comments are
mostly left alone).

Additionally, convert a very few string.Format occurrences to the pre-
dominant .FormatWith pattern and fix some incorrect message strings.
2017-01-04 03:01:26 +01:00
Jon Hanna b567a066e6 Use null-propogation where applicable and useful.
Primarily where it means one fewer field-access or simplifies
event delegate invocation, though one or two cases have just the
lesser advantage of allowing an IL stack dup rather than local access.
2017-01-03 20:08:12 +00:00
James Newton-King 3ae09a80f0 Merge branch 'master' of https://github.com/JamesNK/Newtonsoft.Json 2017-01-03 12:24:15 +13:00
James Newton-King 9feab13f7e -Build 2017-01-03 12:24:01 +13:00
James Newton-King ba23c14d57 Merge pull request #1124 from JonHanna/lazier_largeByteBuffer
Don't assign _largeByteBuffer until clear it will be used.
2017-01-01 15:06:06 +13:00
Jon Hanna ecd265dad9 Don't assign _largeByteBuffer until clear it will be used.
BsonBinaryWriter._largeByteBuffer is lazily-allocated, but a path
following the allocation doesn't use it. Move the allocation into the
path that makes use of it, to avoid the null-check and potentially the
allocation.
2016-12-31 14:35:55 +00:00
James Newton-King 0c24088279 Merge pull request #1121 from JonHanna/fix_1120
Don't write duplicate nulls to trace for object or Uri
2016-12-31 12:07:43 +13:00
Jon Hanna 5648cb50f7 Don't write duplicate nulls to trace for byte[] 2016-12-30 15:20:09 +00:00
Jon Hanna 2abc38a0ad Don't write duplicate nulls to trace for object or Uri
Fixes #1120
2016-12-30 15:06:52 +00:00
James Newton-King 322252a989 Merge branch 'master' of https://github.com/JamesNK/Newtonsoft.Json 2016-12-29 20:47:37 +13:00
James Newton-King 2da811b021 -Added support for extension data names to NamingStrategy
-Added ProcessExtensionDataNames to NamingStrategy
2016-12-29 20:46:29 +13:00
James Newton-King f38ce92306 Merge pull request #1113 from stakx/issue-1112-jsonvalidatingreader-close
Make JsonValidatingReader close underlying JsonReader when CloseInput is true
2016-12-28 12:17:39 +13:00
stakx 7644768580 Make JsonValidatingReader close underlying reader
Add `Close` method override in `JsonValidatingReader` so that the
`CloseInput` property is observed properly. Also add a corresponding
unit test.
2016-12-26 12:21:45 +01:00
James Newton-King ee5a229922 Merge branch 'master' of https://github.com/JamesNK/Newtonsoft.Json 2016-12-26 15:01:15 +13:00
James Newton-King 5d7300f5b4 -Fixed tests 2016-12-26 15:00:40 +13:00
James Newton-King 4099870390 -Added support for any combination of paths and values in JSONPath filter expressions 2016-12-26 14:43:07 +13:00
James Newton-King bf88603c92 Merge pull request #1111 from stakx/issue-1097-clean-up-xml-documentation
Clean up XML documentation comments (continued)
2016-12-25 20:49:20 +13:00
stakx 1eb391c147 Replace "stream" in reader/writer classes' comments
XML documentation comments for JsonReader, JsonWriter and derived
classes often mention "underlying streams". In most cases however,
these types don't operate directly on Streams, but through other types
such as TextReader and TextWriter.

This commit changes these comments to reflect more accurately what
kind of objects the various JSON reader / writer classes operate on.

Additionally the effect of JsonReader.CloseInput and JsonWriter.Close-
Output is made more explicit in the comments for the Close methods.
2016-12-24 02:26:16 +01:00
James Newton-King cf6a917a46 Merge pull request #1109 from stakx/issue-1097-clean-up-xml-documentation
Clean up XML documentation comments (continued)
2016-12-24 10:19:05 +13:00
stakx e19ac3f28c Add & fix crefs in XML document comments
* Add references to types where they are missing.

 * Fix incorrect references to closed generic types.

 * Convert member ID strings to proper references where they can be
   converted without breaking the build. The remaining member ID
   strings usually mean that the comment would have to be rephrased
   for at least one build target / platform.

 * Drop namespaces from type names where they are unnecessary.

 * Fix the odd typo and add additional <c> markup in a few places.
2016-12-23 16:15:24 +01:00
James Newton-King 780100b81f Merge pull request #1106 from stakx/issue-1097-clean-up-xml-documentation
Clean up XML documentation comments (continued)
2016-12-19 22:14:42 +13:00
stakx 937d5a53bb XML comments: consistent formatting of C# keywords 2016-12-19 09:29:22 +01:00
James Newton-King d244812522 Merge pull request #1105 from stakx/issue-1097-clean-up-xml-documentation
Clean up XML documentation comments (continued)
2016-12-18 15:17:01 +13:00
stakx 2e6d2ecd4c Fix typos, punctuation, etc. in XML doc comments
* Simple stuff: typos and missing punctuation and line breaks.

 * Sometimes, two method overloads have quite different documentation.
   Rephrase these to make them more similar.

 * Minor rephrasings like in a previous commit (e.g. "...how output
   should be formatted", "initializes a new instance of...").

 * Obvious incorrect type references in comments. These appear mostly
   in `Utilities/LinqBridge.cs` (nullable vs non-nullable).

 * Remove factually incorrect statement about exceptions thrown.

 * Remove comments for explicitly implemented interface methods.
2016-12-18 01:01:46 +01:00
James Newton-King 5456067b11 Merge pull request #1098 from stakx/issue-1097-clean-up-xml-documentation-comments
Fix minor issues in XML documentation comments
2016-12-11 13:47:59 +13:00
stakx f27ad19eb0 Amend omission in previous commit 2016-12-11 01:26:14 +01:00
stakx 01f370d1ff Change comments as per @JamesNK's feedback
* Explicitly implemented interfaces don't need comments.

 * Protected constructors of abstract classes should be documented
   like Microsoft does on MSDN.

 * Replace term "Common Language Runtime (CLR) type" with ".NET type".
2016-12-11 01:19:50 +01:00
stakx 3c6b49a3dd Revert crefs that cannot be resolved in all targets 2016-12-11 00:14:03 +01:00
stakx 067768a658 Fix minor issues in XML documentation comments
This fixes several minor issues in the code's documentation comments,
such as spelling errors, missing punctuation and references to other
code elements, and a few other small inconsistencies.
2016-12-10 22:53:40 +01:00
James Newton-King 133bbc2d38 -Fixed roundtripping double.MaxValue and float.MaxValue as dictionary keys 2016-12-10 17:23:43 +13:00
James Newton-King 3c1fdf9fdd -Derp 2016-12-08 09:50:07 +13:00
James Newton-King 4d425ccd06 -Fix merging null with complex type and MergeNullValueHandling.Ignore 2016-12-08 09:47:01 +13:00
James Newton-King be8ca7a870 -Refactor 2016-11-27 13:58:21 +13:00
James Newton-King 5269ce81c0 -Fixed serializing protected override properties 2016-11-27 13:33:52 +13:00
James Newton-King 38809c68e8 -Refactor away var 2016-11-07 13:33:53 -08:00