Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit 5a967b2

Browse files
committed
Cache doesn't need clearing when adding new feature
1 parent 0aacea0 commit 5a967b2

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Microsoft.AspNetCore.Http.Features/FeatureReferences.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,15 @@ public TFeature Fetch<TFeature, TState>(
3737
}
3838

3939
var feature = cached;
40-
if (feature == null)
40+
if (feature == null || cleared)
4141
{
4242
feature = Collection.Get<TFeature>();
4343
if (feature == null)
4444
{
4545
feature = factory(state);
4646

4747
Collection.Set(feature);
48-
if (!cleared)
49-
{
50-
Cache = default(TCache);
51-
}
48+
5249
Revision = Collection.Revision;
5350
}
5451
cached = feature;

0 commit comments

Comments
 (0)