Cache doesn't need clearing when resolving uncached feature

This commit is contained in:
Ben Adams 2016-02-03 05:29:19 +00:00
parent 0aacea0faf
commit 982aa08cda
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;