Selaa lähdekoodia

* Control.cs: optimized performance in InitControlsCache()

svn path=/trunk/mcs/; revision=84990
Vladimir Krasnov 18 vuotta sitten
vanhempi
sitoutus
8efb5783bf

+ 4 - 0
mcs/class/System.Web/System.Web.UI/ChangeLog

@@ -1,3 +1,7 @@
+2007-08-29  Vladimir Krasnov  <[email protected]>
+
+	* Control.cs: optimized performance in InitControlsCache()
+
 2007-08-28  Marek Habersack  <[email protected]>
 
 	* Page.cs: The following property values are returned from cached

+ 6 - 2
mcs/class/System.Web/System.Web.UI/Control.cs

@@ -769,7 +769,7 @@ namespace System.Web.UI
 
 #endif
 
-		internal void ResetControlsCache ()
+		void ResetControlsCache ()
 		{
 			_controlsCache = null;
 
@@ -777,14 +777,18 @@ namespace System.Web.UI
 				Parent.ResetControlsCache ();
 		}
 
-		internal Hashtable InitControlsCache ()
+		Hashtable InitControlsCache ()
 		{
 			if (_controlsCache != null)
 				return _controlsCache;
 
 			if ((this.stateMask & IS_NAMING_CONTAINER) != 0 || Parent == null)
 				//LAMESPEC: MS' docs don't mention it, but FindControl is case insensitive.
+#if NET_2_0
+				_controlsCache = new Hashtable (StringComparer.OrdinalIgnoreCase);
+#else
 				_controlsCache = new Hashtable (CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
+#endif
 			else
 				_controlsCache = Parent.InitControlsCache ();