System.Xml.Xsl.IlGen.XmlILVisitor.VisitDocOrderDistinct C# (CSharp) Method

VisitDocOrderDistinct() protected method

Generate code for for QilNodeType.DocOrderDistinct.
protected VisitDocOrderDistinct ( QilUnary ndDod ) : QilNode
ndDod System.Xml.Xsl.Qil.QilUnary
return QilNode
        protected override QilNode VisitDocOrderDistinct(QilUnary ndDod) {
            // DocOrderDistinct applied to a singleton is a no-op
            if (ndDod.XmlType.IsSingleton)
                return Visit(ndDod.Child);

            // Handle any special-case patterns that are rooted at DocOrderDistinct
            if (HandleDodPatterns(ndDod))
                return ndDod;

            // Sort results of child expression by document order and remove duplicate nodes
            // cache = runtime.DocOrderDistinct(cache);
            this.helper.LoadQueryRuntime();
            NestedVisitEnsureCache(ndDod.Child, typeof(XPathNavigator));
            this.iterCurr.EnsureStack();
            this.helper.Call(XmlILMethods.DocOrder);
            return ndDod;
        }
XmlILVisitor