Author: kostat
Date: 2008-02-07 02:15:16 -0500 (Thu, 07 Feb 2008)
New Revision: 95121

Modified:
   trunk/mcs/class/System.Configuration/System.Configuration/ChangeLog
   
trunk/mcs/class/System.Configuration/System.Configuration/ClientConfigurationSystem.cs
Log:
performance: refactor out the Configuration object construction from 
GetSection() to the ctor

Modified: trunk/mcs/class/System.Configuration/System.Configuration/ChangeLog
===================================================================
--- trunk/mcs/class/System.Configuration/System.Configuration/ChangeLog 
2008-02-07 07:14:28 UTC (rev 95120)
+++ trunk/mcs/class/System.Configuration/System.Configuration/ChangeLog 
2008-02-07 07:15:16 UTC (rev 95121)
@@ -1,3 +1,8 @@
+2008-02-07  Konstantin Triger <[EMAIL PROTECTED]>
+
+       * ClientConfigurationSystem.cs: performance: refactor out the 
Configuration
+               object construction from GetSection() to the ctor.
+
 2008-01-16  Zoltan Varga  <[EMAIL PROTECTED]>
 
        * ConfigurationElement.cs: Allow non-public constructors. Fixes #353554.

Modified: 
trunk/mcs/class/System.Configuration/System.Configuration/ClientConfigurationSystem.cs
===================================================================
--- 
trunk/mcs/class/System.Configuration/System.Configuration/ClientConfigurationSystem.cs
      2008-02-07 07:14:28 UTC (rev 95120)
+++ 
trunk/mcs/class/System.Configuration/System.Configuration/ClientConfigurationSystem.cs
      2008-02-07 07:15:16 UTC (rev 95121)
@@ -36,15 +36,20 @@
 
        internal class ClientConfigurationSystem : IInternalConfigSystem
        {
-               object IInternalConfigSystem.GetSection (string configKey)
-               {
+               readonly Configuration cfg;
+
+               public ClientConfigurationSystem () {
                        Assembly a = Assembly.GetEntryAssembly();
                        string exePath = 
AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
             
                        if (a == null && exePath == null)
                                exePath = "";
             
-                       Configuration cfg = 
ConfigurationManager.OpenExeConfigurationInternal (ConfigurationUserLevel.None, 
a, exePath);
+                       cfg = ConfigurationManager.OpenExeConfigurationInternal 
(ConfigurationUserLevel.None, a, exePath);
+               }
+
+               object IInternalConfigSystem.GetSection (string configKey)
+               {
                        if (cfg == null)
                                return null;
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to