Hoist path out of loop in BarebonesMatcher

This is an oopsie from a previous change.
This commit is contained in:
Ryan Nowak 2018-07-16 20:35:55 -07:00
parent 0cd41c5544
commit 5f29e8b062
1 changed files with 2 additions and 1 deletions

View File

@ -31,9 +31,10 @@ namespace Microsoft.AspNetCore.Routing.Matchers
throw new ArgumentNullException(nameof(feature));
}
var path = httpContext.Request.Path.Value;
for (var i = 0; i < Matchers.Length; i++)
{
if (Matchers[i].TryMatch(httpContext.Request.Path.Value))
if (Matchers[i].TryMatch(path))
{
feature.Endpoint = Matchers[i].Endpoint;
feature.Values = new RouteValueDictionary();