Skip to content

Commit 544086e

Browse files
committed
refactor: 提升性能
1 parent 0abd144 commit 544086e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/BootstrapBlazor/Router/RouteTableFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ internal static class RouteTableFactory
2323
public static RouteContext Create(IEnumerable<Assembly> assemblies, string url)
2424
{
2525
RefreshRouteTable(assemblies);
26-
if (url.IndexOf("?", StringComparison.OrdinalIgnoreCase) > 0) url = url[..url.IndexOf("?")];
26+
var len = url.IndexOf("?", StringComparison.OrdinalIgnoreCase);
27+
if (len > 0) url = url[..len];
2728
var routeContext = new Microsoft.AspNetCore.Components.Routing.RouteContext(url);
2829
Routes.Route(routeContext);
2930
return new RouteContext()

0 commit comments

Comments
 (0)