private void CheckAttributes(XmlAttributeNode[] attributeNodes, int attributeCount)
{
// For large numbers of attributes, sorting the attributes (n * lg(n)) is faster
if (_attributeSorter == null)
_attributeSorter = new AttributeSorter();
if (!_attributeSorter.Sort(attributeNodes, attributeCount))
{
int attribute1, attribute2;
_attributeSorter.GetIndeces(out attribute1, out attribute2);
if (attributeNodes[attribute1].QNameType == QNameType.Xmlns)
XmlExceptionHelper.ThrowDuplicateXmlnsAttribute(this, attributeNodes[attribute1].Namespace.Prefix.GetString(), xmlnsNamespace);
else
XmlExceptionHelper.ThrowDuplicateAttribute(this, attributeNodes[attribute1].Prefix.GetString(), attributeNodes[attribute2].Prefix.GetString(), attributeNodes[attribute1].LocalName.GetString(), attributeNodes[attribute1].Namespace.Uri.GetString());
}
}