From 5f29e8b0627992a79259e3942a1ad5c083bd0340 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Mon, 16 Jul 2018 20:35:55 -0700 Subject: [PATCH] Hoist path out of loop in BarebonesMatcher This is an oopsie from a previous change. --- .../Matchers/BarebonesMatcher.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/Microsoft.AspNetCore.Routing.Tests/Matchers/BarebonesMatcher.cs b/test/Microsoft.AspNetCore.Routing.Tests/Matchers/BarebonesMatcher.cs index 68a6763606..d70cd6eece 100644 --- a/test/Microsoft.AspNetCore.Routing.Tests/Matchers/BarebonesMatcher.cs +++ b/test/Microsoft.AspNetCore.Routing.Tests/Matchers/BarebonesMatcher.cs @@ -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();