Merge pull request #524 from benaadams/patch-4

Cache doesn't need clearing when resolving uncached feature
This commit is contained in:
Louis DeJardin 2016-03-08 20:58:50 -08:00
commit 626f1173fa
1 changed files with 2 additions and 5 deletions

View File

@ -37,7 +37,7 @@ namespace Microsoft.AspNetCore.Http.Features
}
var feature = cached;
if (feature == null)
if (feature == null || cleared)
{
feature = Collection.Get<TFeature>();
if (feature == null)
@ -45,10 +45,7 @@ namespace Microsoft.AspNetCore.Http.Features
feature = factory(state);
Collection.Set(feature);
if (!cleared)
{
Cache = default(TCache);
}
Revision = Collection.Revision;
}
cached = feature;