Code cleanup.

This commit is contained in:
Chris Ross 2014-11-10 09:17:17 -08:00
parent 1dd3a2ee1f
commit ba693dd383
1 changed files with 2 additions and 3 deletions

View File

@ -84,18 +84,17 @@ namespace Microsoft.AspNet.Owin
}; };
// owin.CallCancelled is required but the feature may not be present. // owin.CallCancelled is required but the feature may not be present.
object ignored;
if (context.GetFeature<IHttpRequestLifetimeFeature>() != null) if (context.GetFeature<IHttpRequestLifetimeFeature>() != null)
{ {
_entries[OwinConstants.CallCancelled] = new FeatureMap<IHttpRequestLifetimeFeature>(feature => feature.RequestAborted); _entries[OwinConstants.CallCancelled] = new FeatureMap<IHttpRequestLifetimeFeature>(feature => feature.RequestAborted);
} }
else if (!_context.Items.TryGetValue(OwinConstants.CallCancelled, out ignored)) else if (!_context.Items.ContainsKey(OwinConstants.CallCancelled))
{ {
_context.Items[OwinConstants.CallCancelled] = CancellationToken.None; _context.Items[OwinConstants.CallCancelled] = CancellationToken.None;
} }
// owin.Version is required. // owin.Version is required.
if (!context.Items.TryGetValue(OwinConstants.OwinVersion, out ignored)) if (!context.Items.ContainsKey(OwinConstants.OwinVersion))
{ {
_context.Items[OwinConstants.OwinVersion] = "1.0"; _context.Items[OwinConstants.OwinVersion] = "1.0";
} }