[Mono-dev] [PATCH] System.Configuration/ClientConfigurationSystem.cs
Miguel de Icaza
miguel at novell.com
Wed Feb 6 13:50:10 EST 2008
Hey!
This looks great.
On Tue, 2008-02-05 at 02:05 -0800, Konstantin Triger wrote:
> Hello all,
>
> This is a small perf refactoring ensuring the Configuration object for an exe is initialized only once.
> Please approve.
>
> Index: System.Configuration/ClientConfigurationSystem.cs
> ===================================================================
> --- System.Configuration/ClientConfigurationSystem.cs (revision 94855)
> +++ System.Configuration/ClientConfigurationSystem.cs (working copy)
> @@ -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;
>
>
> Regards,
> Konstantin Triger
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
More information about the Mono-devel-list
mailing list