Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Insert()

static bool MS.Internal.Xml.XPath.Query.Insert ( List< XPathNavigator > buffer,
XPathNavigator nav )
inlinestaticinherited

Definition at line 87 of file Query.cs.

88 {
89 int num = 0;
90 int num2 = buffer.Count;
91 if (num2 != 0)
92 {
93 switch (CompareNodes(buffer[num2 - 1], nav))
94 {
95 case XmlNodeOrder.Same:
96 return false;
97 case XmlNodeOrder.Before:
98 buffer.Add(nav.Clone());
99 return true;
100 }
101 num2--;
102 }
103 while (num < num2)
104 {
105 int median = GetMedian(num, num2);
106 switch (CompareNodes(buffer[median], nav))
107 {
108 case XmlNodeOrder.Same:
109 return false;
110 case XmlNodeOrder.Before:
111 num = median + 1;
112 break;
113 default:
114 num2 = median;
115 break;
116 }
117 }
118 buffer.Insert(num, nav.Clone());
119 return true;
120 }
static XmlNodeOrder CompareNodes(XPathNavigator l, XPathNavigator r)
Definition Query.cs:127
static int GetMedian(int l, int r)
Definition Query.cs:122

References System.buffer, System.Xml.XPath.XPathNavigator.Clone(), MS.Internal.Xml.XPath.Query.CompareNodes(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Xml.Dictionary, and MS.Internal.Xml.XPath.Query.GetMedian().

Referenced by MS.Internal.Xml.XPath.DocumentOrderQuery.Evaluate(), MS.Internal.Xml.XPath.ParentQuery.Evaluate(), MS.Internal.Xml.XPath.PreSiblingQuery.Evaluate(), MS.Internal.Xml.XPath.XPathAncestorQuery.Evaluate(), MS.Internal.Xml.XPath.MergeFilterQuery.Evaluate(), and MS.Internal.Xml.XPath.IDQuery.ProcessIds().