Merge pull request #1126 from JonHanna/remove_list_array

Remove some unnecessary list and array allocations.
This commit is contained in:
James Newton-King
2017-01-05 11:32:37 +13:00
committed by GitHub
8 changed files with 76 additions and 55 deletions
@@ -1898,7 +1898,11 @@ namespace Newtonsoft.Json.Serialization
if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Info)
{
string parameters = string.Join(", ", contract.CreatorParameters.Select(p => p.PropertyName).ToArray());
string parameters = string.Join(", ", contract.CreatorParameters.Select(p => p.PropertyName)
#if NET20 || NET35
.ToArray()
#endif
);
TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(reader as IJsonLineInfo, reader.Path, "Deserializing {0} using creator with parameters: {1}.".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType, parameters)), null);
}