-Fixed bad performance with dynamic

-Added support for creating collections with an IEnumerable<T> constructor
This commit is contained in:
James Newton-King
2013-03-11 17:20:15 +13:00
parent 92de187a74
commit 0e753888d0
10 changed files with 189 additions and 105 deletions
@@ -974,16 +974,14 @@ namespace Newtonsoft.Json.Converters
{
manager.PushScope();
string namespacePrefix = null;
string namespaceUri = null;
foreach (IXmlNode attribute in node.Attributes)
{
if (attribute.NamespaceUri == "http://www.w3.org/2000/xmlns/")
{
namespacePrefix = (attribute.LocalName != "xmlns")
string namespacePrefix = (attribute.LocalName != "xmlns")
? attribute.LocalName
: string.Empty;
namespaceUri = attribute.Value;
string namespaceUri = attribute.Value;
manager.AddNamespace(namespacePrefix, namespaceUri);
}
@@ -1017,9 +1015,6 @@ namespace Newtonsoft.Json.Converters
writer.WriteEndObject();
}
if (namespacePrefix != null)
manager.RemoveNamespace(namespacePrefix, namespaceUri);
manager.PopScope();
}