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

Commit cbd2130

Browse files
committed
Apply opt to non-generic
1 parent d5d00e3 commit cbd2130

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Kestrel.Core/Internal/Http/HttpProtocol.Generated.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ object IFeatureCollection.this[Type key]
8686
{
8787
get
8888
{
89-
object feature;
89+
object feature = null;
9090
if (key == IHttpRequestFeatureType)
9191
{
9292
feature = _currentIHttpRequestFeature;
@@ -171,7 +171,7 @@ object IFeatureCollection.this[Type key]
171171
{
172172
feature = _currentIHttpSendFileFeature;
173173
}
174-
else
174+
else if (MaybeExtra != null)
175175
{
176176
feature = ExtraFeatureGet(key);
177177
}

tools/CodeGenerator/HttpProtocolFeatureCollection.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ object IFeatureCollection.this[Type key]
118118
{{
119119
get
120120
{{
121-
object feature;{Each(allFeatures, feature => $@"
121+
object feature = null;{Each(allFeatures, feature => $@"
122122
{(feature.Index != 0 ? "else " : "")}if (key == {feature.Name}Type)
123123
{{
124124
feature = _current{feature.Name};
125125
}}")}
126-
else
126+
else if (MaybeExtra != null)
127127
{{
128128
feature = ExtraFeatureGet(key);
129129
}}

0 commit comments

Comments
 (0)