Skip to content

Commit

Permalink
Backport r145721
Browse files Browse the repository at this point in the history
svn path=/branches/mono-2-6/mcs/; revision=145722
  • Loading branch information
grendello committed Nov 9, 2009
1 parent 551c3e3 commit 6c93b0c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 7 additions & 0 deletions mcs/class/System.Web/System.Web.Configuration_2.0/ChangeLog
@@ -1,3 +1,10 @@
2009-11-09 Marek Habersack <mhabersack@novell.com>

* WebConfigurationManager.cs: there's no need to cache sections by
_file_ path - using section name and web.config path is more than
enough and it reduces the number of cache entries
considerably. Fixes bug #550730

2009-10-07 Marek Habersack <mhabersack@novell.com>

* WebConfigurationManager.cs: GetSection doesn't perform string +
Expand Down
Expand Up @@ -402,7 +402,7 @@ internal static object GetSection (string sectionName, string path, HttpContext
if (String.IsNullOrEmpty (config_vdir))
config_vdir = "/";

int sectionCacheKey = GetSectionCacheKey (sectionName, path, config_vdir);
int sectionCacheKey = GetSectionCacheKey (sectionName, config_vdir);
object cachedSection;
if (sectionCache.TryGetValue (sectionCacheKey, out cachedSection) && cachedSection != null)
return cachedSection;
Expand Down Expand Up @@ -584,11 +584,10 @@ static void AddSectionToCache (int key, object section)
sectionCache = tmpTable;
}

static int GetSectionCacheKey (string sectionName, string path, string vdir)
static int GetSectionCacheKey (string sectionName, string vdir)
{
return (sectionName != null ? sectionName.GetHashCode () : 0) ^
((path != null ? path.GetHashCode () : 0) + 37) ^
((vdir != null ? vdir.GetHashCode () : 0));
((vdir != null ? vdir.GetHashCode () : 0) + 37);
}


Expand Down

0 comments on commit 6c93b0c

Please sign in to comment.