diff --git a/ICD.Common.Utils/Xml/XmlReaderExtensions.cs b/ICD.Common.Utils/Xml/XmlReaderExtensions.cs index e974c79..fbddbbc 100644 --- a/ICD.Common.Utils/Xml/XmlReaderExtensions.cs +++ b/ICD.Common.Utils/Xml/XmlReaderExtensions.cs @@ -42,17 +42,11 @@ namespace ICD.Common.Utils.Xml if (extends == null) throw new ArgumentNullException("extends"); - if (!extends.HasAttributes) - return Enumerable.Empty(); - - List attributes = new List(); while (extends.MoveToNextAttribute()) - attributes.Add(new IcdXmlAttribute(extends.Name, extends.Value)); + yield return new IcdXmlAttribute(extends.Name, extends.Value); // Move back to element. extends.MoveToElement(); - - return attributes.ToArray(); } /// diff --git a/ICD.Common.Utils/Xml/XmlUtils.cs b/ICD.Common.Utils/Xml/XmlUtils.cs index 9becca2..d2413f8 100644 --- a/ICD.Common.Utils/Xml/XmlUtils.cs +++ b/ICD.Common.Utils/Xml/XmlUtils.cs @@ -60,7 +60,7 @@ namespace ICD.Common.Utils.Xml using (IcdXmlReader reader = new IcdXmlReader(xml)) { reader.ReadToNextElement(); - return reader.GetAttributes(); + return reader.GetAttributes().ToArray(); } }