From: Oleg T. <he...@us...> - 2005-10-26 15:08:41
|
Update of /cvsroot/mvp-xml/Common/v2/src/XPath In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10046/v2/src/XPath Modified Files: XPathCache.cs Log Message: Index: XPathCache.cs =================================================================== RCS file: /cvsroot/mvp-xml/Common/v2/src/XPath/XPathCache.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- XPathCache.cs 25 Oct 2005 21:33:44 -0000 1.2 +++ XPathCache.cs 26 Oct 2005 15:08:29 -0000 1.3 @@ -43,11 +43,15 @@ /// </summary> private static XPathExpression GetCompiledExpression(string expression, XPathNavigator source) { - XPathExpression expr = Cache[expression]; + XPathExpression expr; - // No double checks. At most we will compile twice. No big deal. - if (expr == null) - { + if (Cache.ContainsKey(expression)) + { + expr = Cache[expression]; + } + else + { + // No double checks. At most we will compile twice. No big deal. expr = source.Compile(expression); Cache[expression] = expr; } |