diff --git a/Src/Newtonsoft.Json/Linq/JObject.cs b/Src/Newtonsoft.Json/Linq/JObject.cs index 7bfb525b..34cd887e 100644 --- a/Src/Newtonsoft.Json/Linq/JObject.cs +++ b/Src/Newtonsoft.Json/Linq/JObject.cs @@ -744,13 +744,15 @@ namespace Newtonsoft.Json.Linq PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes) { - PropertyDescriptorCollection descriptors = new PropertyDescriptorCollection(null); - + var propertiesArray = new PropertyDescriptor[Count]; + var i = 0; foreach (KeyValuePair propertyValue in this) { - descriptors.Add(new JPropertyDescriptor(propertyValue.Key)); + propertiesArray[i] = new JPropertyDescriptor(propertyValue.Key); + i++; } + var descriptors = new PropertyDescriptorCollection(propertiesArray); return descriptors; }