Update of /cvsroot/mvp-xml/Common/v2/src/XPath
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27809/v2/src/XPath
Modified Files:
IndexingXPathNavigator.cs
Log Message:
Index: IndexingXPathNavigator.cs
===================================================================
RCS file: /cvsroot/mvp-xml/Common/v2/src/XPath/IndexingXPathNavigator.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- IndexingXPathNavigator.cs 25 Oct 2005 21:33:44 -0000 1.2
+++ IndexingXPathNavigator.cs 26 Oct 2005 16:15:42 -0000 1.3
@@ -621,23 +621,24 @@
//converted to a string as if by a call to the string function; it
//returns a node-set containing the nodes in the same document as
//the context node that have a value for the named key equal to this string.
- List<XPathNavigator> indexedNodes = null;
+ List<XPathNavigator> indexedNodes = null, tmpIndexedNodes;
if (keyValue is XPathNodeIterator)
{
XPathNodeIterator nodes = keyValue as XPathNodeIterator;
while (nodes.MoveNext())
{
- if (index.ContainsKey(nodes.Current.Value))
+
+ if (index.TryGetValue(nodes.Current.Value, out tmpIndexedNodes))
{
if (indexedNodes == null)
indexedNodes = new List<XPathNavigator>();
- indexedNodes.AddRange(index[nodes.Current.Value]);
+ indexedNodes.AddRange(tmpIndexedNodes);
}
}
}
else
{
- indexedNodes = index[keyValue.ToString()];
+ index.TryGetValue(keyValue.ToString(), out indexedNodes);
}
if (indexedNodes == null)
indexedNodes = new List<XPathNavigator>(0);
|